C:/Programmi/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x167): undefined reference to `___cpu_features_init'
I am guessing that MinGW GCC is not correctly installed. I might be wrong, but this error looks like a Windows Vista or Bad MinGW install Error.
Are you running Windows Vista? If, Yes then I suggest re-installing MinGW and hope the new MinGW works under Vista as the MinGW group said it would.
Things to do to check a Mingw GCC install
1. Is Cygwin installed; if yes, then it can not be in the windows PATH. If it is errors happen.
2. Do you have more than one copy of MinGW installed? I think DevCpp installs an copy of MinGW.
If yes, please make sure none of them are in the Windows PATH.
If yes, please make sure none of them is in the path X:\MinGW were X is any of your drive letters
If No, only one copy installed it can be in the Windows PATH and installed in X:\MinGW
( Mingw likes to look for files in X:\MinGW if it exists so can not use that path on multiple MinGW installs)
If above fails, I suggest removing MinGW and Re-installing it.
To install I suggest, using the new MinGW installer MinGW-5.1.4.exe; pick the current release. And pick components of runtime, w32api, binutils, core, gpp/g++ and make.
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780&release_id=595197If you want to do it manually your problem is most likely in the runtime component, so getting that installed again and verify the mingwm10.dll DLL is in your path may fix the issue. I normally copy the mingwm10.dll DLL to a folder that is always in my path, but at the end of my path.
If you wish to do more troubleshooting, you can run my MinGW info script below.
My Test Script called version-of-mingw.bat
To use, copy it into an bat file in your MinGW folder that contains the bin subfolder and run the bat file.
@echo off
REM credit to Peter Ward work in ReactOS Build Environment RosBE.cmd it gave me a starting point that I edited.
::
:: Display the current version of GCC, ld, make and others.
::
REM %CD% works in Windows XP, not sure when it was added to Windows
REM set MINGWBASEDIR=C:\MinGW
set MINGWBASEDIR=%CD%
ECHO MINGWBASEDIR=%MINGWBASEDIR%
SET PATH=%MINGWBASEDIR%\bin;%SystemRoot%\system32
if exist %MINGWBASEDIR%\bin\gcc.exe (gcc -v 2>&1 | find "gcc version")
REM if exist %MINGWBASEDIR%\bin\gcc.exe gcc -print-search-dirs
if exist %MINGWBASEDIR%\bin\c++.exe (c++ -v 2>&1 | find "gcc version")
if exist %MINGWBASEDIR%\bin\gcc-sjlj.exe (gcc-sjlj.exe -v 2>&1 | find "gcc version")
if exist %MINGWBASEDIR%\bin\gcc-dw2.exe (gcc-dw2.exe -v 2>&1 | find "gcc version")
if exist %MINGWBASEDIR%\bin\gdb.exe (gdb.exe -v | find "GNU gdb")
if exist %MINGWBASEDIR%\bin\nasm.exe (nasm -v)
if exist %MINGWBASEDIR%\bin\ld.exe (ld -v)
if exist %MINGWBASEDIR%\bin\windres.exe (windres --version | find "GNU windres")
if exist %MINGWBASEDIR%\bin\dlltool.exe (dlltool --version | find "GNU dlltool")
if exist %MINGWBASEDIR%\bin\pexports.exe (pexports | find "PExports" )
if exist %MINGWBASEDIR%\bin\mingw32-make.exe (mingw32-make -v | find "GNU Make")
if exist %MINGWBASEDIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin)
REM ECHO "The minGW runtime version is the same as __MINGW32_VERSION"
if exist "%MINGWBASEDIR%\include\_mingw.h" (type "%MINGWBASEDIR%\include\_mingw.h" | find "__MINGW32_VERSION" | find "#define")
if exist "%MINGWBASEDIR%\include\w32api.h" (type "%MINGWBASEDIR%\include\w32api.h" | find "__W32API_VERSION")
:_end
PAUSE
My Results
MINGWBASEDIR=C:\Apps\MinGW_Std
gcc version 3.4.5 (mingw special)
gcc version 3.4.5 (mingw special)
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU dlltool 2.17.50 20060824
GNU Make 3.81
#define __MINGW32_VERSION 3.14
#define __W32API_VERSION 3.11
Press any key to continue . . .
Tim S