ld: cannot find -lstdc++
ld: cannot find -lstdc++
我试图将编译分解为这四个步骤,但最后一个对我来说似乎有问题。
cpp hello.cpp > hello.i
g++ -S hello.i
as -o hello.o hello.s
ld -o hello hello.o -lstdc++
我在这里和这里搜索了问题,但这没有帮助。
以详细模式运行给了我
attempt to open hello.o succeeded
hello.o
attempt to open /usr/i686-linux-gnu/lib32/libstdc++.so failed
attempt to open /usr/i686-linux-gnu/lib32/libstdc++.a failed
attempt to open //usr/local/lib32/libstdc++.so failed
attempt to open //usr/local/lib32/libstdc++.a failed
attempt to open //lib32/libstdc++.so failed
attempt to open //lib32/libstdc++.a failed
attempt to open //usr/lib32/libstdc++.so failed
attempt to open //usr/lib32/libstdc++.a failed
attempt to open //usr/local/lib/i386-linux-gnu/libstdc++.so failed
attempt to open //usr/local/lib/i386-linux-gnu/libstdc++.a failed
attempt to open //usr/local/lib/libstdc++.so failed
attempt to open //usr/local/lib/libstdc++.a failed
attempt to open //lib/i386-linux-gnu/libstdc++.so failed
attempt to open //lib/i386-linux-gnu/libstdc++.a failed
attempt to open //lib/libstdc++.so failed
attempt to open //lib/libstdc++.a failed
attempt to open //usr/lib/i386-linux-gnu/libstdc++.so failed
attempt to open //usr/lib/i386-linux-gnu/libstdc++.a failed
attempt to open //usr/lib/libstdc++.so failed
attempt to open //usr/lib/libstdc++.a failed
ld: cannot find -lstdc++
有什么建议吗?提前谢谢。
不要直接调用链接器,而是尝试通过 gcc
或 g++
间接调用它:
cpp hello.cpp > hello.i
g++ -S hello.i
as -o hello.o hello.s
g++ -o hello hello.o
相关文章:
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- OpenMP卸载说'fatal error: could not find accel/nvptx-none/mkoffload'
- 使用.find函数在c++中查找字符和另一个字符之间的大小
- 在 QVector<std::unique_ptr 上使用 std::find<Type>>
- 错误"Could not find Boost"(缺少:上下文标头)
- /usr/bin/ld: cannot find -lc++
- std::find,返回所有找到的值的替代方法,而不仅仅是存在重复的向量的第一个值
- 使用 find 解析文件会给出不同文件的奇怪结果
- 在 ifcondition al中 find() C++ STL 中的 == a.end() 有什么用?
- Cannot find -lglad
- "Cannot find -l<directory>"错误 - CMake
- 为什么在向量上使用 std::find() 时会出现错误?
- 为什么映射插入和 map.find() 的单次迭代比插入和 map.find() 的两次单独迭代慢得多
- C++ find() 在存储为变量时返回不同的值
- set::find 查找不存在的元素
- 使用 std::find 时没有匹配的函数调用错误
- OS X: ld: 找不到 -lstdc++ 的库
- libreoffice cannot find -lstdc++
- ld: cannot find -lstdc++
- GCC 错误"/usr/bin/ld: cannot find -lstdc++"