简体   繁体   English

SFML 2.1 Code :: Blocks静态链接不起作用,

[英]SFML 2.1 Code::Blocks Static linking not working,

I am new to the idea of linking libraries in c++, and am trying to get SFML to work with C++. 我不熟悉使用c ++链接库的想法,并且正在尝试使SFML与C ++一起使用。 I am on Windows 7 64-bit and am using Code Blocks. 我在Windows 7 64位上,正在使用代码块。 I have downloaded the 32-bit mingw GCC SFML DW2 version of SFML. 我已经下载了SFML的32位mingw GCC SFML DW2版本。 I followed this tutorial: http://www.sfml-dev.org/tutorials/2.0/start-cb.php to set up code blocks. 我遵循了本教程: http : //www.sfml-dev.org/tutorials/2.0/start-cb.php设置代码块。 I am staticly linking the libraries. 我正在静态链接库。 When I press the "Build" button, I get whole host of errors, with undefined reference to '__Unwind_Resume' and '__gxx_personality_v0'. 当我按下“构建”按钮时,我得到了很多错误,其中包括对“ __Unwind_Resume”和“ __gxx_personality_v0”的未定义引用。 I have looked up this issue, and have only found command line fixes, using g++ instead of gcc. 我查找了此问题,并且仅使用g ++而不是gcc找到了命令行修复程序。 I cannot do this within the codeblocks UI. 我无法在代码块用户界面中执行此操作。 Can someone give me a hand? 有人可以帮我吗?

The version of the compiler shipped with code::blocks is the 32-bit 4.7 TDM-SJLJ one, so you need the version of SFML compiled with the same compiler ( GCC 4.7 TDM (SJLJ) - 32 bits ) code::blocks随附的编译器版本是32位4.7 TDM-SJLJ,因此您需要使用同一编译器( GCC 4.7 TDM (SJLJ) - 32 bits )编译的SFML版本。

If you want to use the 64-bit version of the library you need to install the 64-bit version of the compiler, available here 如果要使用库的64位版本,则需要安装64位版本的编译器(可在此处获得)

将设置->编译器->工具链中的链接器程序更改为g ++。exe或mingw-g ++。exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM