Golang cannot be run under linux after compilation. What is the reason for the segment error?

Go programs compiled under Mac are uploaded to two linux servers, one of which runs normally, but the other displays a segment error. what may be the reason?

Linux version 2.6.32-573.22.1.el6.x86_64
can run

Linux version 3.10.0-514.26.2.el7.x86_64
cannot run, execute display segment error

Mar.04,2021

obviously you need to cross-compile

learn about Golang cross-compilation

< hr >

if it still doesn't work, see the next question https://codeshelper.com/q/10.

.

don't hit each hand

. The go program running under

linux is compiled directly under linux to get the executable file to run. Do not compile under mac and run under linux.


you may need to see how many bits of 32 or 64 the operating system is. Cross-compilation parameters are different


upload code. Ftp software defaults to ASCII, to binary upload.


different versions of the kernel will not be fully compatible. 2.x 3.x 4.x has changed a lot. If the program uses the interface of the kernel and happens to change the interface, it will be core dump.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9f6bb-47836.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9f6bb-47836.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?