关于MinGW GCC编译C++程序动态链接到libgcc_s_dw2-1.dll的问题
2013-05-19 21:15
471 查看
如果你使用MinGW GCC 4.4.0默认选项编译C++程序,就会动态链接到libgcc_s_dw2-1.dll,编译后的执行文件运行时会出现错误:
其中的原因:
Dynamic linking with libgcc_s_dw2-1.dll is necessary to throw exceptions between different modules, such as between two DLLs or a DLL and an EXE. Consequently, it is the default for all languages other than C.
解决办法:
To disable this dynamic linking, use -static-libgcc. To enable this dynamic linking in C, use-shared-libgcc.
Eclipse中参数设置方法:
To add this flag in Eclipse, go to Project->Properties. Under "C++ Build", select "Settings". Under "MinGW C++ Linker", select "Miscellaneous". Add "-static-libgcc" to the "Linker flags" field. You may have to do this for your other build configurations and
projects.
其中的原因:
Dynamic linking with libgcc_s_dw2-1.dll is necessary to throw exceptions between different modules, such as between two DLLs or a DLL and an EXE. Consequently, it is the default for all languages other than C.
解决办法:
To disable this dynamic linking, use -static-libgcc. To enable this dynamic linking in C, use-shared-libgcc.
Eclipse中参数设置方法:
To add this flag in Eclipse, go to Project->Properties. Under "C++ Build", select "Settings". Under "MinGW C++ Linker", select "Miscellaneous". Add "-static-libgcc" to the "Linker flags" field. You may have to do this for your other build configurations and
projects.
相关文章推荐
- 关于MinGW编译程序出现缺少libgcc_s_dw2-1.dll问题
- 解决“无法定位程序输入点ucrtbase.terminate于动态链接库api-ms-win-crt-runtime-|1-1-0.dll“问题
- CLion+MinGW CMake进行静态链接,解决程序出现缺少libgcc_s_dw2-1.dll问题
- 关于“无法找到入口——无法定位程序输入点......于动态链接库QtCore4.dll上”的解决方案
- Qt应用静态编译,静态链接,去mingwm10.dll,libgcc_s_dw2-1.dll依赖问题(转)
- 关于C#引用dll动态链接库文件的注释问题
- QT程序发布的一个问题:无法定位程序输入点与动态链接库QtCore4.dll
- mingw qt(可以去掉mingwm10.dll、libgcc_s_dw2-1.dll、libstdc++-6.dll的依赖,mingw默认都是动态链接gcc的库而TDM是静态链接gcc库,tdm版本更好用。用aspack压缩没有问题。qt本身不使用异常处理)good
- Qt应用静态编译,静态链接,去mingwm10.dll,libgcc_s_dw2-1.dll依赖问题
- 【OpenGL】无法定位程序输入点_glewInit@0于动态链接库glew32.dll
- Visual Studio2011安装问题(更新无法定位程序输入点_Atomic_fetch_sub_4动态链接库MSVCR110.dll上的问题)
- 【转】C#生成dll文件:如何用C#编译生成dll文件即动态链接库文件供其它程序调用
- 配置好环境变量,仍出现无法定位程序输入点 ...于动态链接库Qt5Cored.dll和Qt5.Widgetsd.dll
- 关于6位数码管动态扫描显示程序的一些问题
- “无法定位程序输入点 aacEncClose 于动态链接库的奇葩问题
- 第一个DLL程序:动态链接库DLL教程,30分钟快速上手
- 编译和链接都成功,但是找不到cutil32.dll,程序无法启动的问题
- 如何查看一个运行的exe执行程序需要有哪些DLL动态链接库
- 关于动态加载dll问题
- linux动态链接库全局变量共享问题&DLL共享数据段