问题
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.
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
回答1:
Seems like it can't find the MinGW libraries.
Click on Tools -> Compiler Options
In the directory tab, right click Libraries
and change to the MinGW lib directory. In this example, it was C:\MinGW\lib
This might happen if you uninstall, re-install, or upgrade MinGW.
回答2:
if you have install Migwin or cygwin in C then try to install Dev C++ on other directory with latest version. Old version on another directory will still may give you the same error. My problem has been resolve by doing this.
回答3:
I had an error similar to this in Dev-Cpp (4.9.9.2) after installing MinGW32.
[Linker error] undefined reference to `__dyn_tls_init_callback'
[Linker error] undefined reference to `__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:). This fixed the whole problem and Dev-Cpp went back to linking the correct libraries when C:\MinGW32 was not accessible. Changing the Dev-Cpp compiler options library did not work in this case.
来源:https://stackoverflow.com/questions/17098217/dev-cpp-compiler-build-error