Cgo: 64-bit Mode Not Compiled In
When attempting to integrate C code into a Go project, the following error may occur:
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
This error typically stems from a discrepancy in the bit mode of the C compiler used.
Solution:
To resolve this issue, ensure that the C compiler used is compiled with support for 64-bit mode.
For Windows operating systems using MinGW-w64 as the C compiler, the following steps may be performed:
Alternatively, another solution is to use MinGW-w64 or x64-4.8.1-release-posix-seh-rev5. These versions are known to work with 64-bit builds in 64-bit Windows OS but may not support 32-bit builds.
The above is the detailed content of Why Am I Getting 'cc1.exe: sorry, unimplemented: 64-bit mode not compiled in' When Using Cgo?. For more information, please follow other related articles on the PHP Chinese website!