You may also like...

12 Responses

  1. jeff说道:

    请教,我的也出现了同样的报错,也用了同样的gcc版本,依旧如此,我这是哪里配置错了呢,SDK和版本不兼容还是什么问题?能否发一份您能用的SDK版本文件和配置环境清单给我呢?谢谢了
    Thread model: posix
    gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

    G:\app\0\ABAP\workspace\src\0go\gorfc\gorfc>go build gorfc.go
    # runtime/cgo
    G:/app/vscode/.portable/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find G:\app\0\ABAP\SDK\nwrfcsdk\lib: Permission denied
    collect2.exe: error: ld returned 1 exit status
    # runtime/cgo
    gcc: warning: G:\app\0\ABAP\SDK\nwrfcsdk\include: linker input file unused because linking not done
    # runtime/cgo
    gcc: warning: G:\app\0\ABAP\SDK\nwrfcsdk\include: linker input file unused because linking not done
    # runtime/cgo
    (后略)

    • ag说道:

      windows下情况比较多,我现在也没有搭这个环境了。
      建议linux虚拟机开发完部署就好了,linux下的gosaprfc可参考这篇文章:https://www.gavindong.com/2595.html

  2. Geenia说道:

    謝謝分享,另外請教一下
    #安装go saprfc库,這一段若在Windows裡該如何處理? cmd無法執行export..等
    還有執行go build跟go install都會出現如下錯誤,請問您有遇過嗎?!該如何解呢?
    ——-
    # runtime/cgo
    C:/minGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-
    mingw32/bin/ld.exe: cannot find C:\nwrfcsdk\lib: Permission denied
    collect2.exe: error: ld returned 1 exit status
    # runtime/cgo
    gcc: warning: C:\nwrfcsdk\include: linker input file unused because linking not
    done

  3. ag说道:

    如果go build的时候报以下错误,说明安装的MinGW可能安装成32位了,卸载重新安装64位即可(可以通过gcc -v查看gcc的版本):
    # runtime/cgo
    cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

  4. ag说道:

    补充事项两点:
    1.PATH需要添加gcc的路径,例如我安装的是MinGW64,安装在C盘,则PATH应添加 ;C:\mingw64\bin
    2.go get github.com/sap/gorfc的时候老是报错,索性就直接cd到$GOPATH/src下面,使用git clone https://github.com/SAP/gorfc.git

发表评论