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

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
    评论

报告相同问题?

悬赏问题

  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题
  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源