使用标准输入流会导致编译失败
using the standard input stream leads to compilation failure
运行简单的c++程序(例如HelloWorld)没有问题,但当我在代码中使用cin时,我看到以下错误
在中找不到过程入口点__gxx_personality_v0动态链接库C:\Users\username\Desktop\helloworld.exe
我使用MinGW编译器,在windows 10 上的精彩文本
代码:
#include <iostream>
using namespace std;
int main()
{
int x = 1;
cin >> x;
cout << x << endl;
return 0;
}
来自gcc邮件列表中的此存档https://gcc.gnu.org/ml/gcc-help/2002-07/msg00186.html,
__gxx_personality_v0
是定义的G++异常处理模型的一部分GCC中新的C++ABI。符号由libstdc++
提供库,通过g++添加到链接行。
因此,在这种情况下,我确信您使用了mingw-gcc
来编译代码。切换到mingw-g++
或在命令中添加-lstdc++
将完成任务。
相关文章:
- 包含模板文件的递归会导致编译失败
- 提升 1.64 单元测试编译失败
- C++模板的模板编译失败
- 使用已删除的函数进行编译失败,并显示 uclibc
- MinGW-w64 编译失败,nullptr_t
- 使用提升线程时编译失败
- 编译花絮 g++, clang++, 使用 libboost -- g++8 编译失败时 g++7 成功;
- CMake + Qt,moc 编译失败,无法实现 QMetaObject 方法(编译器找不到基本 ui 对象的标头?
- 带有引用的std::tuple在clang中编译失败,但在gcc中编译失败
- 解决由于在哈希函数中使用了不完整的类型而导致的编译失败
- 将XCode升级到verison 11.1后,C++编译失败
- 添加类型名会导致程序编译失败
- 将 qi::lexeme 添加到灵气中的规则时编译失败
- 如果我在下面的代码中使用 list 而不是 vector,为什么在我尝试在迭代器之间执行减法的行中编译失败?
- 返回 std::stringstream - 编译失败
- 编译失败:strlen 不是 std 的成员
- MSBuidel - 将资源文件添加到项目后静态库编译失败
- C++ - 在 std::thread 中调用重载函数时编译失败
- QtWebEngine 到嵌入式 Linux 交叉编译失败
- 使用 glibc 2.7 包含路径编译失败