cmd/go: c-shared header does not compile on Visual Studio #36233
Labels
Comments
And I'm curious that there is no lib file, how is the msvc link the code? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?go1.13.5 windows/386
Does this issue reproduce with the latest release?
Yes
What did you do?
go build -buildmode=c-shared -o client.dll test.go
this command generated a client.h header file, it has some code like this:
typedef signed char GoInt8;
typedef unsigned char GoUint8;
typedef short GoInt16;
typedef unsigned short GoUint16;
typedef int GoInt32;
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt32 GoInt;
typedef GoUint32 GoUint;
typedef SIZE_TYPE GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
typedef float _Complex GoComplex64;
typedef double _Complex GoComplex128;
What did you expect to see?
Hope it can be compiled in VC
What did you see instead?
But this file can not compile in Visual Studio, the error is :
Error 28 error C2061: syntax error : identifier 'GoUintptr'
Error 30 error C2061: syntax error : identifier 'GoComplex64'
Error 32 error C2061: syntax error : identifier 'GoComplex128'
The text was updated successfully, but these errors were encountered: