On 10/29/12 8:22 PM, Sjors Gielen wrote:
> Op 30-10-12 03:47, Alexander Hansen schreef:
>> I've got a Qt-related question.  Gnuplot-4.6.0 added Qt support
>> (not turned on by default) and I wanted to enable this as an
>> option. However, this doesn't work (on 10.8/Xcode CLI 4.5,
>> anyway):
> 
> The problem is the C++ compiler is running in ObjC mode, yet
> includes headers written for C++:
> 
>> c++ [...] -ObjC
> 
>> /sw/lib/qt4-x11/include/QtCore/qnamespace.h:1808:1: error:
>> unknown type name 'class'; did you mean 'Class'?
> 
> This leads to more or less the same behaviour in g++ and clang++.
> The problem can be fixed by changing -ObjC to -ObjC++;
> alternatively, by not giving the flag at all if the source file
> does not use ObjC functionality.
> 
> Tested with the following test case:
> 
> sjors@smbp:/tmp$ cat test.cpp #include <stdio.h>
> 
> class Foo { public: static void print() { printf("foo\n"); } };
> 
> int main(int argc, char *argv[]) { Foo::print(); return 0; } 
> sjors@smbp:/tmp$ c++ test.cpp -o test sjors@smbp:/tmp$ ./test foo 
> sjors@smbp:/tmp$ c++ -ObjC test.cpp -o test test.cpp:3:1: error:
> unknown type name 'class'; did you mean 'Class'? [...] 
> sjors@smbp:/tmp$ c++ -ObjC++ test.cpp -o test sjors@smbp:/tmp$
> ./test foo
> 
> 
> Sjors
> 
> 
> 

Thanks!  The configure script had instances of 'CXXFLAGS="$CXXFLAGS
-ObjC"', and changing those to 'CXXFLAGS="$CXXFLAGS -ObjC++"' seems to
have done what I needed.

-- 
Alexander Hansen, Ph.D.
Fink User Liaison
My package updates: http://finkakh.wordpress.com/

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to