cyrillef / FBX-glTF

FBX glTF importer/exporter plug-in and converter.
MIT License
210 stars 50 forks source link

Linux Make failure #17

Open nmolinski opened 7 years ago

nmolinski commented 7 years ago

Scanning dependencies of target IO-glTF [ 3%] Building CXX object IO-glTF/CMakeFiles/IO-glTF.dir/glslShader.cpp.o In file included from XXX/FBX-glTF-master/IO-glTF/glslShader.cpp:22:0: XXX/FBX-glTF-master/IO-glTF/glslShader.h:51:7: error: ‘void glTF::glslShader::appendCode(const char_t*, ...)’ cannot be overloaded void appendCode (const utility::char_t *format, ...) ; ^ XXX/FBX-glTF-master/IO-glTF/glslShader.h:50:7: error: with ‘void glTF::glslShader::appendCode(const char*, ...)’ void appendCode (const char *format, ...) ; ^ XXX/FBX-glTF-master/IO-glTF/glslShader.cpp:83:54: error: no ‘void glTF::glslShader::appendCode2(const char*, ...)’ member function declared in class ‘glTF::glslShader’ void glslShader::appendCode2 (const char *format, ...) { ^ IO-glTF/CMakeFiles/IO-glTF.dir/build.make:182: recipe for target 'IO-glTF/CMakeFiles/IO-glTF.dir/glslShader.cpp.o' failed make[2]: *** [IO-glTF/CMakeFiles/IO-glTF.dir/glslShader.cpp.o] Error 1 CMakeFiles/Makefile2:85: recipe for target 'IO-glTF/CMakeFiles/IO-glTF.dir/all' failed make[1]: *** [IO-glTF/CMakeFiles/IO-glTF.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 I had installed Casablanca correctly on Ubuntu and I am currently using the 2017 FBX SDK. Not sure why cmake is giving an error because of overloaded functions

Hugo-Pereira commented 7 years ago

I think it's because const char *format and const utility::char_t *format ends up being the same type on Linux, which makes those two functions void appendCode (const utility::char_t *format, ...) ; and void appendCode (const char *format, ...) ; have the same signature.

Haven't managed to find a solution for it yet though

FreakTheMighty commented 7 years ago

For what its worth I have this bug replicated in a dockerfile: https://github.com/AfterNow/FBX-glTF/tree/feature-docker

To build run docker-compose build. The error is

In file included from /FBX-glTF/IO-glTF/glslShader.cpp:22:0:
/FBX-glTF/IO-glTF/glslShader.h:51:7: error: 'void glTF::glslShader::appendCode(const char_t*, ...)' cannot be overloaded
  void appendCode (const utility::char_t *format, ...) ;
       ^
/FBX-glTF/IO-glTF/glslShader.h:50:7: error: with 'void glTF::glslShader::appendCode(const char*, ...)'
  void appendCode (const char *format, ...) ;
       ^
/FBX-glTF/IO-glTF/glslShader.cpp:96:6: error: redefinition of 'void glTF::glslShader::appendCode(const char_t*, ...)'
 void glslShader::appendCode (const utility::char_t *format, ...) {
      ^
/FBX-glTF/IO-glTF/glslShader.cpp:83:6: error: 'void glTF::glslShader::appendCode(const char*, ...)' previously defined here
 void glslShader::appendCode (const char *format, ...) {
      ^
/FBX-glTF/IO-glTF/glslShader.cpp: In member function 'void glTF::glslTech::lighting2(web::json::value, web::json::value)':
/FBX-glTF/IO-glTF/glslShader.cpp:514:109: error: cannot pass objects of non-trivially-copyable type 'utility::string_t {aka class std::basic_string<char>}' through '...'
       _fragmentShader.appendCode (U("if ( cosAngle > cos (radians (u_%s * 0.5)) ) {\n"), szLightFallOffAngle) ;
                                                                                                             ^
/FBX-glTF/IO-glTF/glslShader.cpp:515:112: error: cannot pass objects of non-trivially-copyable type 'utility::string_t {aka class std::basic_string<char>}' through '...'
       _fragmentShader.appendCode (U("attenuation *=max (0., pow (cosAngle, u_%s)) ;\n"), szLightFallOffExponent) ;
                                                                                                                ^
make[2]: *** [IO-glTF/CMakeFiles/IO-glTF.dir/glslShader.cpp.o] Error 1
make[1]: *** [IO-glTF/CMakeFiles/IO-glTF.dir/all] Error 2
make: *** [all] Error 2

** The Dockerfile is pretty messy right now, there are some out of order apt-get commands, I didn't want to invalidate the casablanca build after spending an hour compiling.