Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: c-shared header does not compile on Visual Studio #36233

Open
xp19870106 opened this issue Dec 20, 2019 · 1 comment
Open

cmd/go: c-shared header does not compile on Visual Studio #36233

xp19870106 opened this issue Dec 20, 2019 · 1 comment

Comments

@xp19870106
Copy link

@xp19870106 xp19870106 commented Dec 20, 2019

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'

@xp19870106
Copy link
Author

@xp19870106 xp19870106 commented Dec 20, 2019

And I'm curious that there is no lib file, how is the msvc link the code?

@ALTree ALTree changed the title Go build dll can not work in VC cmd/go: c-shared header does not compile on Visual Studio Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.