Compilation error on MSVC++ 2005

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
khayyam
Posts: 7
Joined: Fri Mar 09, 2007 8:52 pm
Location: France

Compilation error on MSVC++ 2005

Post by khayyam »

Hi all,

On compiling code using irrKlang on MSVC++ 2005, I get the errors :

Code: Select all

irrKlang.h(137) : error C3861: 'visibility': identifier not found
irrKlang.h(137) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
irrKlang.h(137) : error C2146: syntax error : missing ';' before identifier 'ISoundEngine'
irrKlang.h(137) : error C2143: syntax error : missing ';' before '*'
irrKlang.h(137) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
irrKlang.h(140) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
And on commenting #define IRRKLANG_API __attribute__((visibility("default"))) on line 112 in irrKlang.h and deleting IRRKLANG_API on line 137, the compilation succeeds.

Bug ?

And it works well on mingw without changing anything :)
blackhole12
Posts: 2
Joined: Wed Jan 17, 2007 5:44 am

Post by blackhole12 »

I ran into this problem myself and landed on this post whilst trying to fix it. I tried compiling the irrklang examples and noted that they did not have a problem compiling. Thats when i remebered that my release and debug modes had different preprocessor definitions - my Debug build was strictly a CONSOLE build, and my release mode was a win32 build (no console window). I switched to release mode and, voila! it compiled fine. I added in WIN32; to my debug preprocessors and it compiled.

Apparently, you MUST have WIN32 declared in your preprocessor definitions. Why? Good question! But thats why its not compiling :D

NOTE: The subsystem you are using (windows or console) does not matter. The only thing that you need is to have WIN32 in your preprocessor definitions.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Interesting, thanks for posting the solution here. I'm going to fix this in the next version of irrKlang.
Post Reply