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

CGO (compiler) error in linux #13

Closed
lulouis opened this issue Apr 2, 2019 · 2 comments · Fixed by #19
Closed

CGO (compiler) error in linux #13

lulouis opened this issue Apr 2, 2019 · 2 comments · Fixed by #19

Comments

@lulouis
Copy link

lulouis commented Apr 2, 2019

Dear sap engineers:

I'm an experienced LinuxOS developer,I know something about gcc compiler and dynamic libraries call.
But now,CGO compiler throw error like this picture .

Thanks very much , sir.
Louis ,Shenzhen.

深度截图_选择区域_20190402152718

@antihax
Copy link
Contributor

antihax commented Jul 18, 2019

Remove all that junk. Ended up with this:

#cgo linux CFLAGS: -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSAPonUNIX
#cgo linux CFLAGS: -DSAP_UC_is_wchar -DSAPwithUNICODE -D__NO_MATH_INLINES -DSAPwithTHREADS -DSAPonLIN
#cgo linux CFLAGS: -O2 -g
#cgo linux CFLAGS: -pthread -pipe -Wno-unused-variable

#cgo linux CFLAGS: -I/usr/local/sap/nwrfcsdk/include
#cgo linux LDFLAGS: -L/usr/local/sap/nwrfcsdk/lib -lsapnwrfc -lsapucum

#cgo linux LDFLAGS: -O2 -g
#cgo linux LDFLAGS: -pthread

@MinasWang
Copy link

export CGO_LDFLAGS_ALLOW=".*"

export CGO_CFLAGS_ALLOW=".*"

after add it to whitelist, "go build" work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants