← Back to team overview

kicad-developers team mailing list archive

-std=c++0x break build on MinGW and wxWidgets 2.9.4


Just a heads up for anyone who attempts to build testing r3800 on Windows with MinGW (GCC 4.7.2) and wxWidgets 2.9.4, you will get the following build errors everywhere <wx/string.h> is included in the source:

/mingw/include/wx-2.9/wx/wxcrtbase.h: In function 'char* wxStrdup(const char*)': /mingw/include/wx-2.9/wx/wxcrtbase.h:697:62: error: '_strdup' was not declared in this scope /mingw/include/wx-2.9/wx/wxcrtbase.h: In function 'wchar_t* wxStrdup(const wchar_t*)': /mingw/include/wx-2.9/wx/wxcrtbase.h:698:68: error: 'wcsdup' was not declared in this scope


/mingw/include/wx-2.9/wx/string.h: In function 'int Stricmp(const char*, const char*)': /mingw/include/wx-2.9/wx/string.h:174:31: error: 'strcasecmp' was not declared in this scope make[2]: *** [common/CMakeFiles/common.dir/dialog_about/AboutDialog_main.cpp.obj] Error 1 [ 43%] Building CXX object common/CMakeFiles/common.dir/dialog_about/dialog_about.cpp.obj

My guess is that _strdup, wcsdup, and strcasecmp are wrapped in an #ifdef/#endif block in the MinGW header files that undefines these functions when the -std=++0x flag is used. I confirmed this by commenting out the line in the main CMakeList.txt file. Obviously this also fails due to the new std::unique_ptr calls which require the -std=c++0x flag. So I attempted to rebuild wxWidgets 2.9.4 with -std=c++0x defined and got this error message:

cxx:1466:33: error: 'isascii' was not declared in this scope

I don't have time to look at this right now so hopefully someone can figure this out before I can get some time to look at it.


Follow ups