cmd/cgo: aborts on attempt to link to static library on windows #44308
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
First time I've used Go, so 1.15.8 is the only version I've used.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using Microsoft's compiler (Visual Studio 2019 Professional) from the command line, I created a simple static-link library with a single function in two files, test.h and test.c,which contain the following lines:
test.h
int test(const char* value);
test.c
I used the following command line calls to build the test.lib file:
I then copied the test.h and test.lib files into the same folder as my Go code. My Go code, in a file called "ls.go", contains the following interface lines at the top:
My Go code has no reference to the test() function contained in the static link library.
What did you expect to see?
I expected to see nothing, which is what I have typically seen with a successful compile.
What did you see instead?
When I executed the line "go build -x ls.go" I am getting the following output:
If it's of any assistance, following this, I checked the error code:
The text was updated successfully, but these errors were encountered: