WIN7 Ultimate 64-bit compiled 32-bit Golang program with CGO

Source: Internet
Author: User

A problem was encountered during the development process.

The client server is a 32-bit Windows system, and the software system must be compiled into a 32-bit system to operate properly on the client.

My development environment:

WIN7 Flagship edition 64-bit

Golang 1.8 64-bit

tmd-gcc5.1 64-bit

In this case, use the batch file as follows:

Set Goos=windowsset goarch=386set cgo_enabled=1go build Pcmspause

The system calls Go-sqlite3, using the CGO call, to report a compilation error because of the exception that is called by GCC

The use of cross-compilation does not always solve the problem, the final solution is as follows:

1, install the 32-bit version of golang1.8

2, install the 32-bit TMD-GCC

3, re-execute the above Bat batch command, run successfully

WIN7 Ultimate 64-bit compiled 32-bit Golang program with CGO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.