没有找到-lstdc++-static的库
library not found for -lstdc++-static
本文关键字:-lstdc++-static 的库 更新时间:2023-10-16
我正在尝试构建wxFormBuilder_v3.5.0-beta-source。它附带了一个用于创建构建文件的shell文件,但是它总是遇到以下错误:
==== Building Premake4 ====
Linking Premake4
ld: library not found for -lstdc++-static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [bin/release/premake4] Error 1
make: *** [Premake4] Error 2
./create_build_files4.sh: line 91: ./premake/macosx/bin/release/premake4: No such file or directory
./create_build_files4.sh: line 92: ./premake/macosx/bin/release/premake4: No such file or directory
./create_build_files4.sh: line 93: ./premake/macosx/bin/release/premake4: No such file or directory
./create_build_files4.sh: line 95: ./premake/macosx/bin/release/premake4: No such file or directory
我正在运行Mac OS X 10.9.4,是的,我已经安装了XCode,并且在这台机器上成功构建/安装了c++项目。
我知道我必须首先安装wxWidgets才能工作,并且我已经成功地构建/编译/安装了wxWidgets。
下面是shell文件的第87-96行(我在行号前面加了前缀供您参考):
[87] # Build premake
[88] cd build
[89] make CONFIG=Release -C./premake/$platform
[90]
[91] ./premake/$platform/bin/release/premake4 --file=./premake/solution.lua $wxunicode $wxroot $wxversion $mediactrl $shared $arch codeblocks
[92] ./premake/$platform/bin/release/premake4 --file=./premake/solution.lua $wxunicode $wxroot $wxversion $mediactrl $shared $arch $rpath codelite
[93] ./premake/$platform/bin/release/premake4 --file=./premake/solution.lua $wxunicode $wxroot $wxversion $mediactrl $shared $arch $rpath gmake
[94] if [ "$platform" = "macosx" ]; then
[95] ./premake/$platform/bin/release/premake4 --file=./premake/solution.lua $wxunicode $wxroot $wxversion $mediactrl $shared $arch xcode3
[96] fi
我不担心文件路径丢失。我试着从正确的目录直接运行make
,仍然得到这个错误:
==== Building Premake4 ====
Linking Premake4
ld: library not found for -lstdc++-static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [bin/release/premake4] Error 1
make: *** [Premake4] Error 2
我主要关心的是找到-lstdc++-static
库并安装它,但我在网上找不到它。我能找到的唯一相关的东西是在编译iOS应用程序时改变XCode中的设置,这不是这里的情况。需要进行的任何更改都需要在文本编辑器中进行。
表示预制作文件路径:./premake/macosx/bin/release/premake4不存在。请注意,您使用的是相对路径(从。/开始),而不是绝对路径。尝试使用绝对路径并检查premake4可执行文件的位置。
ld: library not found for -lstdc++-static意味着你的链接器不能使用静态链接创建对象。请检查是否可以构建静态二进制文件。
创建hello world测试:
#include <iostream>
int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
}
尝试构建它
clang++ test.cpp -o test
和
clang++ -static test.cpp -o test
这样一个测试的结果向您保证您是否能够创建二进制文件。
相关文章:
- 为什么即使使用-cudart-static进行编译,库用户仍然需要链接到cuda运行时
- 如何处理 c++ 中类实现中的"invalid use of non-static data member"?
- 收到错误"invalid use of non-static data member 'stu::n' "
- LNK1104:无法打开libpjproject-i386-Win32-vc14-Debug-Static.lib
- 我应该在 C++ 中何时/为什么使用 STATIC?
- 在VS2019项目中集成ImageMagick:x64-windows-static library
- 如何处理Boost Spirit X3导致Visual Studio 2019 "static initialization order fiasco"?
- "static char __ = []() -> char"的含义
- 当初始值设定项是基类名时'initializer does not name a non-static data member or base class'错误
- OS X: ld: 找不到 -lstdc++ 的库
- 无法在 DLL 中链接 SDL2-static.lib
- 如何摆脱C++中未解析的外部符号"private: static char"错误?
- C++线程"Call to non-static member function without an object argument"
- 出现这种错误的原因是什么"invalid use of non-static data member "
- static是如何使用ClassA::m_variable处理所有类对象的
- LNK2001:未解析的外部符号public:static类std::vector
- 使用-static libstdc++时std::线程弱,因此在运行时会导致崩溃
- 你能初始化unique_ptrs "static const vectors"吗?(C++17 与 GCC 7.3)
- 为什么异常不适用于 OSX 上的 gcc7 和 -static-libgcc?
- 没有找到-lstdc++-static的库