Qt in Visual Studio 2010 messes up other libs

Started by
6 comments, last by 3DModelerMan 12 years, 2 months ago
I installed the Visual Studio 2010 add in for Qt, and I added SPARK to my engine. I went to link my Qt editor project to my engine (which now depends on SPARK) and I get this huge list of errors:

1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C2143: syntax error : missing ')' before '&'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C2143: syntax error : missing ';' before '&'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C2182: 'Particle' : illegal use of type 'void'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C2059: syntax error : ')'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C2143: syntax error : missing ';' before 'const'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(226): error C2208: 'const int' : no members defined using this type
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(236): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(282): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(347): error C2589: '(' : illegal token on right side of '::'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(347): error C2143: syntax error : missing ';' before '::'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(347): error C2059: syntax error : '::'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(348): error C2143: syntax error : missing ';' before '{'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(348): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(353): error C2065: 'particle' : undeclared identifier
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(353): error C2597: illegal reference to non-static member 'SPK::Emitter::Particle'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(353): error C3867: 'SPK::Emitter::Particle': function call missing argument list; use '&SPK::Emitter::Particle' to create a pointer to member
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(353): error C2761: 'generateVelocity' : member function redeclaration not allowed
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(353): error C2143: syntax error : missing ';' before 'const'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(353): error C2059: syntax error : 'const'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(354): error C2143: syntax error : missing ';' before '{'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Core/SPK_Emitter.h(354): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(98): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(119): error C2065: 'particle' : undeclared identifier
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(119): error C2597: illegal reference to non-static member 'SPK::Emitter::Particle'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(119): error C3867: 'SPK::Emitter::Particle': function call missing argument list; use '&SPK::Emitter::Particle' to create a pointer to member
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(119): error C2062: type 'float' unexpected
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(120): error C2143: syntax error : missing ';' before '{'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StraightEmitter.h(120): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_SphericEmitter.h(151): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_NormalEmitter.h(119): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_RandomEmitter.h(51): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(50): error C2327: 'SPK::Emitter::Particle' : is not a type name, static, or enumerator
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(61): error C2065: 'particle' : undeclared identifier
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(61): error C2597: illegal reference to non-static member 'SPK::Emitter::Particle'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(61): error C3867: 'SPK::Emitter::Particle': function call missing argument list; use '&SPK::Emitter::Particle' to create a pointer to member
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(61): error C2062: type 'float' unexpected
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(62): error C2143: syntax error : missing ';' before '{'
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Emitters/SPK_StaticEmitter.h(62): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\tanner\documents\projects\icicle engine\icicle engine\include\depend\spark\Extensions/Modifiers/SPK_Rotator.h(75786193): fatal error C1903: unable to recover from previous error(s); stopping compilation


I tried asking on the SPARK forum but no one answered. When I try linking to my engine and SPARK in a normal test project it compiles and runs just fine, but as soon as I try to use Qt it gets totally messed up. Does anyone know why it might doing this?
Advertisement
Based on http://spark.developpez.com/doc/_s_p_k___emitter_8h_source.html it looks like line 226 is:

void emit(Particle& particle) const;

I'm guessing you have a "typedef void Particle;" or similar elsewhere in the code that is conflicting.
I haven't typedef'd anything to have the name Particle. But I think Qt might have a class named Particle. How can I make sure that Qt's is not used?
From what Adam_42 wrote, I assume the problem is the emit keyword of Qt. The Qt documentation suggests this workaround: http://developer.qt.nokia.com/doc/qt-4.8/signalsandslots.html#using-qt-with-3rd-party-signals-and-slots
That's probably it. I'll post back once I try and see. I'm going to have to create a different project file so it will take a little bit. Thanks.
How do you disable the Qt keywords in Visual Studio? I can't find anything aside from .pro file documentation.
It's written in link that brx posted: http://developer.qt....gnals-and-slots Read the section "Using Qt with 3rd Party Signals and Slots" at the bottom of page.
Try adding QT_NO_KEYWORDS preprocessor define to your project. At least that is what "CONFIG += no_keywords" line in .pro file means.
Oh YESSS! It worked. Thanks alot for the help.

This topic is closed to new replies.

Advertisement