'Cross compile Golang to dll of 386 in x64 platform happend error

Cross compile Golang to dll of 386 in x64 platform happend error The program depend Consul API, I want to build it to DLL for CPP of 32bit transfer. But, show "cannot find -lmsvcrt" when cross compile in X64 platform.the command is :

go build --buildmode=c-shared -o consul-api-x86.dll main.go

and the env already set GOARCH=386,and rename mingw64-x86-make.exe to make.exe,and use go of 386 and mingw64 of x86 to retry still fails.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source