dongta5621 2019-06-11 16:19
浏览 3830

go / pkg / tool / linux_amd64 / link:运行gcc失败:退出状态1 / usr / bin / ld:找不到-lgdal

I am trying to run go build on my sources.

go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lgdal
collect2: error: ld returned 1 exit status

My LD_LIBRARY_PATH variable contains /home/fzd/project/lib64, the path to the dir of the libgdal.so file. My PKG_CONFIG_PATH contains the path to the dir of a .pc file with the following contents :

prefix=/home/fzd/project
exec_prefix=${prefix}
libdir=${prefix}/lib64
deplibdir=${prefix}/lib64
includedir=${prefix}/include

Name: myLibs
Description: Libs
Requires:
Version: v1.0
Libs: -L${deplibdir} -lgdal
Cflags: -I${includedir}

I don't know which variable to check. Everything seems fine, and the fun part is that, when I clone my repo elsewhere, I don't have the issue (same LD_LIBRARY_PATH, etc.)

Does anyone have a clue about what I could check?

I am using go1.11.1, on CentOS7.6.

  • 写回答

1条回答 默认 最新

  • doujiu6976 2019-06-12 15:59
    关注

    Here are a few things I did to solve this issue:

    • rm -rf ~/.cache/go-build : this contained a few build artifacts
    • rm -rf ${MyProject}/{bin,pkg} : for the same reason
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘