nvpro-samples / gl_vk_chopper

Simple vulkan rendering example.
Apache License 2.0
204 stars 45 forks source link

fail build #15

Closed sl1pkn07 closed 4 years ago

sl1pkn07 commented 8 years ago
[  2%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/GLSLProgram.cpp.o
In file included from /home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:16:0:
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/main.h:92:51: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #   define  LOGE(...)  { nvprintfLevel(2, __FILE__"("S__LINE__"): **ERROR**:\n"__VA_ARGS__); }
                                                   ^
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:19:37: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 char* GLSLProgram::incPaths[] = {"/"};
                                     ^
In file included from /home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:16:0:
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp: In member function 'GLuint GLSLProgram::compileProgram(const char*, const char*, const char*, GLenum, GLenum, int)':
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/main.h:92:63: error: unable to find string literal operator 'operator""__VA_ARGS__' with 'const char [105]', 'long unsigned int' arguments
 #   define  LOGE(...)  { nvprintfLevel(2, __FILE__"("S__LINE__"): **ERROR**:\n"__VA_ARGS__); }
                                                               ^
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:324:13: note: in expansion of macro 'LOGE'
             LOGE("%s: Failed to compile VtxShader:\n%s\n", curVSName ? curVSName:"VSNoname", temp);
             ^~~~
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/main.h:92:63: error: unable to find string literal operator 'operator""__VA_ARGS__' with 'const char [105]', 'long unsigned int' arguments
 #   define  LOGE(...)  { nvprintfLevel(2, __FILE__"("S__LINE__"): **ERROR**:\n"__VA_ARGS__); }
                                                               ^
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:341:9: note: in expansion of macro 'LOGE'
         LOGE("%s: Failed to compile FragShader:\n%s\n", curFSName ? curFSName:"VSNoname", temp);
         ^~~~
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/main.h:92:63: error: unable to find string literal operator 'operator""__VA_ARGS__' with 'const char [105]', 'long unsigned int' arguments
 #   define  LOGE(...)  { nvprintfLevel(2, __FILE__"("S__LINE__"): **ERROR**:\n"__VA_ARGS__); }
                                                               ^
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:359:13: note: in expansion of macro 'LOGE'
             LOGE("%s: Failed to compile GShader:\n%s\n", curGSName ? curGSName:"VSNoname", temp);
             ^~~~
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/main.h:92:63: error: unable to find string literal operator 'operator""__VA_ARGS__' with 'const char [105]', 'long unsigned int' arguments
 #   define  LOGE(...)  { nvprintfLevel(2, __FILE__"("S__LINE__"): **ERROR**:\n"__VA_ARGS__); }
                                                               ^
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:387:9: note: in expansion of macro 'LOGE'
         LOGE("%s: Failed to link program:\n%s\n", curProgName ?curProgName:"Noname", temp);
         ^~~~
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp: In static member function 'static char* GLSLProgram::readTextFile(const char*)':
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/main.h:92:63: error: unable to find string literal operator 'operator""__VA_ARGS__' with 'const char [105]', 'long unsigned int' arguments
 #   define  LOGE(...)  { nvprintfLevel(2, __FILE__"("S__LINE__"): **ERROR**:\n"__VA_ARGS__); }
                                                               ^
/home/sl1pkn07/aplicaciones/gl_vk_chopper/shared_sources/nv_helpers_gl/GLSLProgram.cpp:404:3: note: in expansion of macro 'LOGE'
   LOGE("Cannot open \"%s\" for read!\n", filename);
   ^~~~
make[2]: *** [shared_sources/CMakeFiles/shared_sources.dir/build.make:207: shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/GLSLProgram.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: shared_sources/CMakeFiles/shared_sources.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

Vulkan from GIT

maybe problems with GCC 6.1.1?

greetings

jpotier commented 8 years ago

Exactly the same problem on linux with gcc version 6.1.1 20160707 (GCC)

GreyGodzilla commented 8 years ago

Insert a space after the end quotes in the #define statement. Searching on the internet revealed it as a feature of C++x11 when appending a variable name to a string literal in quotes.

sl1pkn07 commented 4 years ago

this error is gone with gcc 9.2.0

closing