Comments (11)
The error message shows that SAP NWRFC SDK include files are not found.
Is SAP NWRFC SDK installed on your system and in which folder?
The GO should be informed about the location of include files, like described in README: https://github.com/SAP/gorfc#install-gorfc
Alternatively you can clone the repository and adapt #cgo windows options in gorfc.go
#cgo windows CFLAGS: -IC:/Tools/nwrfcsdk/include/
#cgo windows LDFLAGS: -LC:/Tools/nwrfcsdk/lib/ -lsapnwrfc -llibsapucum
from gorfc.
I am trying to run the commands using git bash. Facing the below error while running the command "go get github.com/sap/gorfc"
Error
$ go get github.com/sap/gorfc
#github.com/sap/gorfc
D:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsapnwrfc
D:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibsapucum
collect2.exe: error: ld returned 1 exit status
#github.com/sap/gorfc
In file included from D:\Software\nwrfcsdk\nwrfcsdk/include/sapnwrfc.h:7,
from github.com\sap\gorfc\gorfc.go:62:
D:\Software\nwrfcsdk\nwrfcsdk/include/sapucrfc.h:705:5: warning: 'align' attribute directive ignored [-Wattributes]
typedef __declspec(align(16)) SAP_SRAW platform_max_t[16];
^~~~~~~
In file included from github.com\sap\gorfc\gorfc.go:62:
D:\Software\nwrfcsdk\nwrfcsdk/include/sapnwrfc.h:29: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4267) // disable warning: conversion from 'size_t' to 'const unsigned int'
In file included from D:\Software\nwrfcsdk\nwrfcsdk/include/sapnwrfc.h:7,
from github.com\sap\gorfc\gorfc.go:62:
D:\Software\nwrfcsdk\nwrfcsdk/include/sapucrfc.h:1427:27: warning: 'unicodeId' defined but not used [-Wunused-variable]
static SAP_RAW SAP_UNUSED unicodeId[] = cR("@(#) Unicode");
from gorfc.
The error log shows that SAP NWRFC SDK libraries are not found.
In which folder is SAP NWRFC SDK installed on your system and did you set the env variables following the installation steps ?
The dir $CGO_LDFLAGS
(or dir $env:CGO_LDFLAGS
in PS) should show SAP NWRFC SDK libraries. Could you please check that on your system?
from gorfc.
Env variables are set as below:
In user variable - SAPNWRFC_HOME is set to D:\Software\nwrfcsdk\nwrfcsdk
In system variable - Path added as D:\Software\nwrfcsdk\nwrfcsdk\lib
from gorfc.
And CGO_LDFLAGS ?
The dir $CGO_LDFLAGS (or dir $env:CGO_LDFLAGS in PS) should show SAP NWRFC SDK libraries. Could you please check that on your system?
from gorfc.
Should i set the GCO_LDFLAGS in env variable?
I actually ran the below commands on git bash from readme document:
export CGO_CFLAGS="-I $SAPNWRFC_HOME/include"
export CGO_LDFLAGS="-L $SAPNWRFC_HOME/lib"
export CGO_CFLAGS_ALLOW=.*
export CGO_LDFLAGS_ALLOW=.*
go get github.com/stretchr/testify
and when i ran the command "go get github.com/sap/gorfc" facing the error as shown above.
from gorfc.
I have also tired the alternate method suggested.
Made the below changes in gorfc.go file:
#cgo windows CFLAGS: -ID:/Software/nwrfcsdk/nwrfcsdk/include
#cgo windows LDFLAGS: -LD:/Software/nwrfcsdk/nwrfcsdk/lib -lsapnwrfc -llibsapucum
PFB the error:
$ go run sap_connection.go
#github.com/sap/gorfc/gorfc
D:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsapnwrfc
D:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibsapucum
collect2.exe: error: ld returned 1 exit status
#github.com/sap/gorfc/gorfc
In file included from D:/Software/nwrfcsdk/nwrfcsdk/include/sapnwrfc.h:7,
from ....\pkg\mod\github.com\sap\[email protected]\gorfc\gorfc.go:52:
D:/Software/nwrfcsdk/nwrfcsdk/include/sapucrfc.h:705:5: warning: 'align' attribute directive ignored [-Wattributes]
typedef __declspec(align(16)) SAP_SRAW platform_max_t[16];
^~~~~~~
In file included from ....\pkg\mod\github.com\sap\[email protected]\gorfc\gorfc.go:52:
D:/Software/nwrfcsdk/nwrfcsdk/include/sapnwrfc.h:29: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4267) // disable warning: conversion from 'size_t' to 'const unsigned int'
In file included from D:/Software/nwrfcsdk/nwrfcsdk/include/sapnwrfc.h:7,
from ....\pkg\mod\github.com\sap\[email protected]\gorfc\gorfc.go:52:
D:/Software/nwrfcsdk/nwrfcsdk/include/sapucrfc.h:1427:27: warning: 'unicodeId' defined but not used [-Wunused-variable]
static SAP_RAW SAP_UNUSED unicodeId[] = cR("@(#) Unicode");
from gorfc.
I have the same problem, but env setting complete.
OS VERSION: windows 10
GO VERSION: 1.15.2
`C:\Users\John Li\go\pkg\mod\github.com\sap\[email protected]\gorfc>go build
github.com/sap/gorfc/gorfc
In file included from D:\nwrfcsdk\include/sapnwrfc.h:7,
from .\gorfc.go:52:
D:\nwrfcsdk\include/sapucrfc.h:705:5: warning: 'align' attribute directive ignored [-Wattributes]
typedef __declspec(align(16)) SAP_SRAW platform_max_t[16];
^~~~~~~
In file included from .\gorfc.go:52:
D:\nwrfcsdk\include/sapnwrfc.h:29: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4267) // disable warning: conversion from 'size_t' to 'const unsigned int'
In file included from D:\nwrfcsdk\include/sapnwrfc.h:7,
from .\gorfc.go:52:
D:\nwrfcsdk\include/sapucrfc.h:1427:27: warning: 'unicodeId' defined but not used [-Wunused-variable]
static SAP_RAW SAP_UNUSED unicodeId[] = cR("@(#) Unicode");`
from gorfc.
OS VERSION: windows 10
GO VERSION: 1.15.2
exactly same errors like above
from gorfc.
The Windows is not supported until #21 fixed
from gorfc.
Closing due to the sunset of the project.
from gorfc.
Related Issues (20)
- Add the tables parameter to feedback the error HOT 1
- Exit code 3221226356 (hex C0000374); Microsoft build options mapping to GCC HOT 3
- Example program "hello_gorfc", sometimes it works and sometimes it doesn't HOT 3
- Error while calling GetFunctionDescription HOT 1
- gorfc programs do not work with executables generated in go 1.15 (for windows-64 10) HOT 2
- Unable to build in Windows: undetermined C.RfcGetInt8 HOT 6
- Error running hello_gorfc.go on CentOS 7 HOT 7
- while go get github.com/sap/gorfc no Go files in /go/src/github.com/sap/gorfc HOT 1
- 'sapnwrfc.h' file not found HOT 3
- ConnectionFromParams may ignore errors HOT 1
- How to add the tables parameter HOT 1
- Archive the project HOT 5
- Passing blank values in parameters of type "C"
- RFCTYPE_BCD Conversion error being inconsistent
- Could not get the parameter description for "STRING" Error
- mac installation error
- List all the RFC's and its schema using gorfc HOT 13
- gorfc API to fetch the Line Type for custom RFC
- Register destinations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorfc.