相关疑难解决方法(0)

usr/bin/ld:找不到-l <nameOfTheLibrary>

我正在尝试编译我的程序,它返回此错误:

usr/bin/ld: cannot find -l<nameOfTheLibrary>
Run Code Online (Sandbox Code Playgroud)

在我的makefile中,我使用命令g++并链接到我的库,这是指向位于其他目录中的库的符号链接.

是否可以选择添加以使其正常工作?

c++ linux g++

401
推荐指数
8
解决办法
86万
查看次数

如何添加include和lib路径来配置/ make循环?

我需要一个地方在linux盒子里安装库我没有su访问权限.我正在使用〜/ local [/ bin,/ lib,/ include],但我不知道如何告诉./configure在那里寻找库(特别是,我正在尝试编译emacs,这需要libgif ,这不是我的发行版).

我尝试添加

export PATH=$PATH:~/local/bin
export LD_LIBRARY_PATH=~/local/lib
export C_INCLUDE_PATH=~/local/include
export CPLUS_INCLUDE_PATH=~/local/include
Run Code Online (Sandbox Code Playgroud)

到.bashrc但它似乎不起作用.

bash linker autoconf makefile configure

71
推荐指数
3
解决办法
18万
查看次数

运行 flutter linux 应用程序时出现“/usr/bin/ld: 找不到 -lstdc++: 没有这样的文件或目录”

flutter runLinux 桌面应用程序出现此错误

\n
Running "flutter pub get" in proj...            5.3s\nLaunching lib/main.dart on Linux in debug mode...\nCMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):\n  The C++ compiler\n\n    "/usr/bin/clang++"\n\n  is not able to compile a simple test program.\n\n  It fails with the following output:\n\n    Change Dir: /media/kingbob/Dvolve/EData/proj/build/linux/x64/debug/CMakeFiles/CMakeTmp\n\n    Run Build Command(s):/usr/bin/ninja cmTC_5f1b6 && [1/2] Building CXX object CMakeFiles/cmTC_5f1b6.dir/testCXXCompiler.cxx.o\n    [2/2] Linking CXX executable cmTC_5f1b6\n    FAILED: cmTC_5f1b6 \n    : && /usr/bin/clang++   CMakeFiles/cmTC_5f1b6.dir/testCXXCompiler.cxx.o -o cmTC_5f1b6   && :\n    /usr/bin/ld: cannot find -lstdc++: No such file or directory\n    clang: …
Run Code Online (Sandbox Code Playgroud)

ubuntu clang++ flutter-linux

27
推荐指数
2
解决办法
2万
查看次数

cpp:usr/bin/ld:找不到-l <nameOfTheLibrary>

我创建了一个cpp项目,它使用了一个名为的lib文件:libblpapi3_64.so 这个文件来自一个我从Internet上下载的库.

我的项目运行没有任何错误.所以我将它更新为bitbucket.然后我的同事下载并在自己的计算机上运行它.但他得到一个错误:

usr/bin/ld: cannot find -lblpapi3_64.

实际上,我已将其复制到我的项目存储库中.我的意思是我在我的项目下创建了一个名为lib的文件,我使用的所有lib文件都在其中.

还有其他的lib文件liblog4cpp.a,但它们都很好.只有libblpapi3_64.so得到错误.

是因为它是.so文件不是.a文件吗?还是有其他原因?
顺便说一句,libblpapi3_64.sois 的文件名green和其他文件(.a)是white.我认为这不是一个链接文件,它是原始文件.

c++

15
推荐指数
1
解决办法
8万
查看次数

自莫哈韦沙漠以来,链接在自制软件中无效

我现在已经在两台计算机上重现了这种症状,自从将计算机升级到macOS Mojave以来,cmake似乎不再寻找/usr/local/lib(或更恰当地是$(brew --prefix)/lib)由Homebrew提供的库。

尽管有一些方法可以避免这种情况(例如,使用EXECUTE_PROCESS; 搜索结果,然后将结果添加到LINK_LIBRARIES(...)命令中),但都没有理想的方法。莫哈韦沙漠(Mojave)发生了什么变化以打破这种行为?

临时解决方法是将以下内容添加到CMakeLists.txt

# WARNING: Don't hard-code this path
LINK_DIRECTORIES(/usr/local/lib)
Run Code Online (Sandbox Code Playgroud)

我已经尝试brew doctor并更新了所有自制软件包,但无济于事。

cmakemake)显示的特定错误是:

ld: library not found for -l<somelib>
Run Code Online (Sandbox Code Playgroud)

我已经在Homebrew论坛Apple开发者论坛上提出了问题

c++ homebrew cmake

12
推荐指数
2
解决办法
1657
查看次数

我怎么知道Ubuntu 11.04中gcc,g ++/c ++的"默认包含目录","默认链接目录"和"默认链接库"?

对于以下3个编译案例:

gcc -o helloc hello.c                    (1)

g++ -o hellocpp hello.cpp                (2)

c++ -o hellocpp hello.cpp                (3)
Run Code Online (Sandbox Code Playgroud)

在每种情况下,我如何知道"默认包含目录","默认链接目录"和"默认链接库"?我在32位Ubuntu 11.04环境中使用gcc 4.5.2.

对于case(1),gcc是使用标准C库还是GNU C库?两个C库之间有区别吗?

比较情况(2)和(3),编译器使用的"默认链接库"有什么不同吗?他们使用的是标准C++库还是GNU C++库?两个C++库有什么区别?

提前感谢任何建议.

劳伦斯曾

c++ gcc

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

c++ ×4

autoconf ×1

bash ×1

clang++ ×1

cmake ×1

configure ×1

flutter-linux ×1

g++ ×1

gcc ×1

homebrew ×1

linker ×1

linux ×1

makefile ×1

ubuntu ×1