Giter Club home page Giter Club logo

Comments (11)

bsrdjan avatar bsrdjan commented on August 25, 2024

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.

Sapna100 avatar Sapna100 commented on August 25, 2024

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.

bsrdjan avatar bsrdjan commented on August 25, 2024

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.

Sapna100 avatar Sapna100 commented on August 25, 2024

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.

bsrdjan avatar bsrdjan commented on August 25, 2024

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.

Sapna100 avatar Sapna100 commented on August 25, 2024

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.

Sapna100 avatar Sapna100 commented on August 25, 2024

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.

ly020044 avatar ly020044 commented on August 25, 2024

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.

zen37 avatar zen37 commented on August 25, 2024

OS VERSION: windows 10
GO VERSION: 1.15.2

exactly same errors like above

from gorfc.

bsrdjan avatar bsrdjan commented on August 25, 2024

The Windows is not supported until #21 fixed

from gorfc.

bsrdjan avatar bsrdjan commented on August 25, 2024

Closing due to the sunset of the project.

from gorfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.