简体   繁体   English

Dev -Cpp编译器生成错误

[英]Dev -Cpp Compiler Build error

I can't seem to find any thing on how to fix this and i have used Dev-Cpp befor but have never had this problem.I have tried re-installing Dev-Cpp and MinGW but nothing seems to work. 我似乎找不到如何解决此问题的任何东西,我曾经使用过Dev-Cpp befor,但从未遇到过这个问题。我尝试过重新安装Dev-Cpp和MinGW,但似乎无济于事。

i:\gw\lib\crt2.o(.text+0x8) In function `_mingw_CRTStartup'

[Linker error] undefined reference to `__dyn_tls_init_callback' 

[Linker error] undefined reference to `__cpu_features_init' 

i:\gw\lib\crt2.o(.text+0x8) ld returned 1 exit status 

C:\workspace\cpp\Makefile.win [Build Error]  [Project1.exe] Error 1 

Seems like it can't find the MinGW libraries. 似乎找不到MinGW库。

Click on Tools -> Compiler Options In the directory tab, right click Libraries and change to the MinGW lib directory. 单击Tools -> Compiler Options 。在目录选项卡中,右键单击Libraries然后切换到MinGW lib目录。 In this example , it was C:\\MinGW\\lib 在此示例中 ,它是C:\\MinGW\\lib

This might happen if you uninstall, re-install, or upgrade MinGW. 如果您卸载,重新安装或升级MinGW,则可能会发生这种情况。

if you have install Migwin or cygwin in C then try to install Dev C++ on other directory with latest version. 如果已在C中安装Migwin或cygwin ,则尝试在具有最新版本的其他目录上安装Dev C ++。 Old version on another directory will still may give you the same error. 另一个目录上的旧版本仍然可能会给您同样的错误。 My problem has been resolve by doing this. 我的问题已通过这样做解决。

I had an error similar to this in Dev-Cpp (4.9.9.2) after installing MinGW32. 安装MinGW32后,在Dev-Cpp(4.9.9.2)中出现了与此类似的错误。

[Linker error] undefined reference to `__dyn_tls_init_callback' [链接器错误]未定义对__dyn_tls_init_callback的引用

[Linker error] undefined reference to `__cpu_features_init' [链接器错误]未定义对__cpu_features_init的引用

Apparently Dev-Cpp was automatically linking to those new libraries and I just changed the name of the MinGW32 folder (default location was inside C:). 显然Dev-Cpp是自动链接到这些新库的,我只是更改了MinGW32文件夹的名称(默认位置在C:内)。 This fixed the whole problem and Dev-Cpp went back to linking the correct libraries when C:\\MinGW32 was not accessible. 这样就解决了整个问题,并且在无法访问C:\\ MinGW32时,Dev-Cpp返回到链接正确的库。 Changing the Dev-Cpp compiler options library did not work in this case. 在这种情况下,更改Dev-Cpp编译器选项库无效。

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

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