Polytonic / Glitter

Dead Simple OpenGL
http://polytonic.github.io/Glitter/
2.48k stars 418 forks source link

Compilation failed #31

Closed Artiom-M closed 8 years ago

Artiom-M commented 8 years ago

Just installed and generated CMake for CodeLite. First issue it that in CodeLite project file make is called with -j 0 switch.... may be not your project issue. If I fix it it starts to compile then fails in the middle with an error: error: 'wcslen' was not declared in this scope Full message (I tried from the command line, the result is the same as in GUI:

amolchanov@AMOLCHANOV-W54 /C/src/Glitter/Build (master) $ /C/MinGW/bin/mingw32-make.exe [ 24%] Built target BulletCollision [ 28%] Built target zlibstatic Scanning dependencies of target assimp [ 28%] Building CXX object Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/Assimp.cpp.obj In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\postypes.h:40:0, from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:40, from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40, from C:/src/Glitter/Glitter/Vendor/assimp/include/assimp/types.h:70, from C:/src/Glitter/Glitter/Vendor/assimp/include/assimp/cimport.h:49, from C:\src\Glitter\Glitter\Vendor\assimp\code\Assimp.cpp:45: c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:177:11: error: '::wcscat' has not been declared using ::wcscat; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:178:11: error: '::wcscmp' has not been declared using ::wcscmp; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:179:11: error: '::wcscoll' has not been declared using ::wcscoll; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:180:11: error: '::wcscpy' has not been declared using ::wcscpy; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:181:11: error: '::wcscspn' has not been declared using ::wcscspn; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:183:11: error: '::wcslen' has not been declared using ::wcslen; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:184:11: error: '::wcsncat' has not been declared using ::wcsncat; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:185:11: error: '::wcsncmp' has not been declared using ::wcsncmp; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:186:11: error: '::wcsncpy' has not been declared using ::wcsncpy; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:188:11: error: '::wcsspn' has not been declared using ::wcsspn; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:193:11: error: '::wcstok' has not been declared using ::wcstok; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:196:11: error: '::wcsxfrm' has not been declared using ::wcsxfrm; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:204:11: error: '::wcschr' has not been declared using ::wcschr; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:205:11: error: '::wcspbrk' has not been declared using ::wcspbrk; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:206:11: error: '::wcsrchr' has not been declared using ::wcsrchr; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:207:11: error: '::wcsstr' has not been declared using ::wcsstr; ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcschr(wchart, wchar_t)': c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:213:55: error: invalid conversion from 'const wchart' to 'wchart' [-fpermissive] { return wcschr(const_cast(p), c); } ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:212:3: note: initializing argument 1 of 'wchar_t* std::wcschr(wchart, wchar_t)' wcschr(wchart p, wchar_t __c) ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcspbrk(wchart, const wchart)': c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:217:58: error: invalid conversion from 'const wchart' to 'wchart' [-fpermissive] { return wcspbrk(const_cast<const wchar_t*>(s1), s2); } ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:216:3: note: initializing argument 1 of 'wchar_t* std::wcspbrk(wchart, const wchart)' wcspbrk(wchar_t* s1, const wchar_t* s2) ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsrchr(wchart, wchar_t)': c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:221:56: error: invalid conversion from 'const wchart' to 'wchart' [-fpermissive] { return wcsrchr(const_cast(p), c); } ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:220:3: note: initializing argument 1 of 'wchar_t* std::wcsrchr(wchart, wchar_t)' wcsrchr(wchart __p, wchar_t c) ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar: In function 'wchar_t* std::wcsstr(wchart, const wchart)': c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:225:57: error: invalid conversion from 'const wchart' to 'wchart' [-fpermissive] { return wcsstr(const_cast<const wchar_t>(s1), s2); } ^ c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:224:3: note: initializing argument 1 of 'wchar_t* std::wcsstr(wchart, const wchart)' wcsstr(wchar_t* s1, const wchar_t* __s2) ^ In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\string:40:0, from C:/src/Glitter/Glitter/Vendor/assimp/include/assimp/types.h:70, from C:/src/Glitter/Glitter/Vendor/assimp/include/assimp/cimport.h:49, from C:\src\Glitter\Glitter\Vendor\assimp\code\Assimp.cpp:45: c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h: In static member function 'static std::size_t std::char_traits::length(const chartype) ': c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\char_traits.h:358:26: error: 'wcslen' was not declared in this scope { return wcslen(s); } ^ Glitter\Vendor\assimp\code\CMakeFiles\assimp.dir\build.make:62: recipe for target 'Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/Assimp.cpp.obj' failed mingw32-make[2]: _* [Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/Assimp.cpp.obj] Error 1 CMakeFiles\Makefile2:308: recipe for target 'Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/all' failed mingw32-make[1]: * [Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/all] Error 2 Makefile:126: recipe for target 'all' failed mingw32-make: * [all] Error 2

Polytonic commented 8 years ago

I'm not familiar with CodeLite. This looks like a problem upstream with assimp, likely needs a #include <string> in Assimp.cpp. You can try modifying it locally and submitting a patch to them if that fixes your problem?

Artiom-M commented 8 years ago

So for CodeLite it is a bug in Cmake generator : https://public.kitware.com/Bug/view.php?id=15054

#include <string>: it have to be the first includebefore all others in Assimp.cpp in order to fix the issue. Now I have another one, still in Assimp:

||=== Build: all in Glitter (compiler: GNU GCC Compiler) ===| C:\src\Glitter\Glitter\Vendor\assimp\code\StringComparison.h||In function 'int Assimp::ASSIMPstricmp(const char, const char_)':| C:\src\Glitter\Glitter\Vendor\assimp\code\StringComparison.h|143|error: '::strcasecmp' has not been declared| C:\src\Glitter\Glitter\Vendor\assimp\code\StringComparison.h||In function 'int Assimp::ASSIMPstrincmp(const char, const char_, unsigned int)':| C:\src\Glitter\Glitter\Vendor\assimp\code\StringComparison.h|192|error: '::strncasecmp' has not been declared| Glitter\Vendor\assimp\code\CMakeFiles\assimp.dir\build.make|87|recipe for target 'Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/BaseImporter.cpp.obj' failed| CMakeFiles\Makefile2|308|recipe for target 'Glitter/Vendor/assimp/code/CMakeFiles/assimp.dir/all' failed| C:\src\Glitter\Build\Makefile|126|recipe for target 'all' failed| ||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 5 second(s)) ===|

Polytonic commented 8 years ago

Good to know about CodeLite.

I don't know anything about the compilation problem though. I'd suggest you open an issue in their project.

Is there anything else I can help you with?

Artiom-M commented 8 years ago

Do you know an Assimp version which was successfully compiled by Mingw32 ?

Polytonic commented 8 years ago

Unfortunately, no. I don't use MinGW and haven't used it for several years now, so support for it from me will be ... spotty to say the least.

Polytonic commented 8 years ago

I took another quick look at this. It looks like ::strncasecmp() is UNIX-only and that section of code needs to be wrapped in say, #ifdef WIN32 or similar. If you haven't already, I'd suggest opening an issue over with the Assimp project.

Is there anything else I can help you with? If not, may I close this ticket?

Artiom-M commented 8 years ago
Thank you for your help. I will open an issue with Assimp, so you
can close the ticket

  {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/Polytonic/Glitter","title":"Polytonic/Glitter","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/Polytonic/Glitter"}},"updates":{"snippets":[{"icon":"PERSON","message":"@Polytonic in #31: I took another quick look at this. It looks like `::strncasecmp()` is UNIX-only and that section of code needs to be wrapped in say, `#ifdef WIN32` or similar. If you haven't already, I'd suggest opening an issue over with the Assimp project. \r\n\r\nIs there anything else I can help you with? If not, may I close this ticket?"}],"action":{"name":"View Issue","url":"https://github.com/Polytonic/Glitter/issues/31#issuecomment-253111844"}}}