Thread: [Plib-users] link plib into code on mac osx
Brought to you by:
sjbaker
From: Bernhard W. <bw...@ca...> - 2004-10-22 20:50:08
|
I have written a glut-application and compiled it on Mac OS X NOT using = the project development tools but the g++ compiler. Now, I decided to design the user interface using pui but even just = including the headerfile without actually using anything from the = library creates real problems because the (standard) g++-3.3 compiler = doesn't recognise the plib files as C++ and is therefore not able to = compile. I have seen on the mailing list that this problem has surfaced a number = of times but couldn't find a solution apart from the suggestion of not = using plib but compliling the code into my project. Does anyone who had = the problem know, how to deal with it? Or any other ideas? Thanks a lot, Bernhard |
From: Steve B. <sjb...@ai...> - 2004-10-22 22:33:35
|
Bernhard Windisch wrote: > I have written a glut-application and compiled it on Mac OS X NOT using > the project development tools but the g++ compiler. > Now, I decided to design the user interface using pui but even just > including the headerfile without actually using anything from the > library creates real problems because the (standard) g++-3.3 compiler > doesn't recognise the plib files as C++ and is therefore not able to > compile. If it isn't able to compile your application with the PLIB headers in them then the problem is not how it recognises PLIB's files - but rather a matter of what language it thinks the application is written in...header fines have to match the language of the file they are included into. My guess is that your application is in C and that's what the problem is. Could you send us the EXACT output from the compiler? ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Bernhard W. <bw...@ca...> - 2004-10-23 11:57:39
|
Thanks for the immediate reply. > Bernhard Windisch wrote: >> I have written a glut-application and compiled it on Mac OS X NOT >> using the project development tools but the g++ compiler. >> Now, I decided to design the user interface using pui but even just >> including the headerfile without actually using anything from the >> library creates real problems because the (standard) g++-3.3 compiler >> doesn't recognise the plib files as C++ and is therefore not able to >> compile. > > If it isn't able to compile your application with the PLIB headers in > them > then the problem is not how it recognises PLIB's files - but rather a > matter > of what language it thinks the application is written in...header > fines have > to match the language of the file they are included into. > It is completely right that the compiler doesn't recognise the language of pu.h. The problem is that the application IS indeed written in C++ and has been compiled using g++-3.3 without any problems as long as I don't include the header pu.h. > Could you send us the EXACT output from the compiler? Sure, here it is (though only the first few lines because the problem becomes evident and the whole takes up about ten pages... chopin:~/myProgs/MePSim/puiVersion1 bernhardwindisch$ make g++ -g -I/usr/include/gcc/darwin/3.3/c++ -c MePSim.C In file included from /usr/include/plib/sg.h:29, from /usr/include/plib/fnt.h:29, from /usr/include/plib/pu.h:28, from MePSim.C:9: /usr/include/plib/ul.h: In function `void ulEndianSwap(short unsigned int*)': /usr/include/plib/ul.h:336: error: declaration of C function `void ulEndianSwap(short unsigned int*)' conflicts with /usr/include/plib/ul.h:327: error: previous declaration `void ulEndianSwap(unsigned int*)' here /usr/include/plib/ul.h: In function `void ulEndianSwap(float*)': /usr/include/plib/ul.h:342: error: declaration of C function `void ulEndianSwap(float*)' conflicts with /usr/include/plib/ul.h:336: error: previous declaration `void ulEndianSwap(short unsigned int*)' here /usr/include/plib/ul.h: In function `void ulEndianSwap(unsigned int*)': /usr/include/plib/ul.h:342: error: cannot convert `unsigned int*' to `float*' for argument `1' to `void ulEndianSwap(float*)' /usr/include/plib/ul.h: In function `void ulEndianSwap(int*)': /usr/include/plib/ul.h:343: error: declaration of C function `void ulEndianSwap(int*)' conflicts with /usr/include/plib/ul.h:342: error: previous declaration `void ulEndianSwap(float*)' here /usr/include/plib/ul.h: In function `void ulEndianSwap(short int*)': /usr/include/plib/ul.h:344: error: declaration of C function `void ulEndianSwap(short int*)' conflicts with /usr/include/plib/ul.h:343: error: previous declaration `void ulEndianSwap(int*)' here /usr/include/plib/ul.h: In function `unsigned int ulEndianLittle32(unsigned int)': /usr/include/plib/ul.h:360: error: cannot convert `unsigned int*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `float ulEndianLittleFloat(float)': /usr/include/plib/ul.h:369: error: cannot convert `float*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `void ulEndianLittleArray32(unsigned int*, int)': /usr/include/plib/ul.h:389: error: cannot convert `unsigned int*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `void ulEndianLittleArrayFloat(float*, int) ': /usr/include/plib/ul.h:399: error: cannot convert `float*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `void ulEndianBigArray32(unsigned int*, int)': /usr/include/plib/ul.h:419: error: cannot convert `unsigned int*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `void ulEndianBigArrayFloat(float*, int)': /usr/include/plib/ul.h:429: error: cannot convert `float*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `unsigned int ulEndianBig32(unsigned int)': /usr/include/plib/ul.h:447: error: cannot convert `unsigned int*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' /usr/include/plib/ul.h: In function `float ulEndianBigFloat(float)': /usr/include/plib/ul.h:456: error: cannot convert `float*' to `short int*' for argument `1' to `void ulEndianSwap(short int*)' In file included from /usr/include/plib/fnt.h:29, from /usr/include/plib/pu.h:28, from MePSim.C:9: /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float (*)[4], const float*, const float*)': /usr/include/plib/sg.h:149: error: declaration of C function `void sgMakeCoordMat4(float (*)[4], const float*, const float*)' conflicts with /usr/include/plib/sg.h:146: error: previous declaration `void sgMakeCoordMat4(float (*)[4], float, float, float, float, float, float)' here /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float (*)[4], const float*, const float*)': /usr/include/plib/sg.h:151: error: cannot convert `const float' to `const float*' for argument `2' to `void sgMakeCoordMat4(float (*)[4], const float*, const float*)' /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float (*)[4], const sgCoord*)': /usr/include/plib/sg.h:155: error: declaration of C function `void sgMakeCoordMat4(float (*)[4], const sgCoord*)' conflicts with /usr/include/plib/sg.h:149: error: previous declaration `void sgMakeCoordMat4(float (*)[4], const float*, const float*)' here /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float (*)[4], const float*, const float*)': /usr/include/plib/sg.h:156: error: cannot convert `const float*' to `const sgCoord*' for argument `2' to `void sgMakeCoordMat4(float (*)[4], const sgCoord*)' . . . I would be most grateful for any suggestions. Thanks again, Bernhard |
From: Frederic B. <fre...@fr...> - 2004-10-23 12:09:52
|
Perhaps you included plib headers inside a " extern "C" " clause, like=20 this : extern "C" { #include "plib/ul.h" #include "plib/sg.h" } -Fred Bernhard Windisch a =E9crit : > Thanks for the immediate reply. > >> Bernhard Windisch wrote: >> >>> I have written a glut-application and compiled it on Mac OS X NOT=20 >>> using the project development tools but the g++ compiler. >>> Now, I decided to design the user interface using pui but even just=20 >>> including the headerfile without actually using anything from the=20 >>> library creates real problems because the (standard) g++-3.3=20 >>> compiler doesn't recognise the plib files as C++ and is therefore=20 >>> not able to compile. >> >> >> If it isn't able to compile your application with the PLIB headers in=20 >> them >> then the problem is not how it recognises PLIB's files - but rather a=20 >> matter >> of what language it thinks the application is written in...header=20 >> fines have >> to match the language of the file they are included into. >> > > It is completely right that the compiler doesn't recognise the=20 > language of pu.h. The problem is that the application IS indeed=20 > written in C++ and has been compiled using g++-3.3 without any=20 > problems as long as I don't include the header pu.h. > > >> Could you send us the EXACT output from the compiler? > > > Sure, here it is (though only the first few lines because the problem=20 > becomes evident and the whole takes up about ten pages... > > chopin:~/myProgs/MePSim/puiVersion1 bernhardwindisch$ make > g++ -g -I/usr/include/gcc/darwin/3.3/c++ -c MePSim.C > In file included from /usr/include/plib/sg.h:29, > from /usr/include/plib/fnt.h:29, > from /usr/include/plib/pu.h:28, > from MePSim.C:9: > /usr/include/plib/ul.h: In function `void ulEndianSwap(short unsigned=20 > int*)': > /usr/include/plib/ul.h:336: error: declaration of C function `void > ulEndianSwap(short unsigned int*)' conflicts with > /usr/include/plib/ul.h:327: error: previous declaration `void > ulEndianSwap(unsigned int*)' here > /usr/include/plib/ul.h: In function `void ulEndianSwap(float*)': > /usr/include/plib/ul.h:342: error: declaration of C function `void > ulEndianSwap(float*)' conflicts with > /usr/include/plib/ul.h:336: error: previous declaration `void > ulEndianSwap(short unsigned int*)' here > /usr/include/plib/ul.h: In function `void ulEndianSwap(unsigned int*)': > /usr/include/plib/ul.h:342: error: cannot convert `unsigned int*' to=20 > `float*' > for argument `1' to `void ulEndianSwap(float*)' > /usr/include/plib/ul.h: In function `void ulEndianSwap(int*)': > /usr/include/plib/ul.h:343: error: declaration of C function `void > ulEndianSwap(int*)' conflicts with > /usr/include/plib/ul.h:342: error: previous declaration `void > ulEndianSwap(float*)' here > /usr/include/plib/ul.h: In function `void ulEndianSwap(short int*)': > /usr/include/plib/ul.h:344: error: declaration of C function `void > ulEndianSwap(short int*)' conflicts with > /usr/include/plib/ul.h:343: error: previous declaration `void > ulEndianSwap(int*)' here > /usr/include/plib/ul.h: In function `unsigned int=20 > ulEndianLittle32(unsigned > int)': > /usr/include/plib/ul.h:360: error: cannot convert `unsigned int*' to=20 > `short > int*' for argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `float ulEndianLittleFloat(float)': > /usr/include/plib/ul.h:369: error: cannot convert `float*' to `short=20 > int*' for > argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `void=20 > ulEndianLittleArray32(unsigned int*, > int)': > /usr/include/plib/ul.h:389: error: cannot convert `unsigned int*' to=20 > `short > int*' for argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `void=20 > ulEndianLittleArrayFloat(float*, int) > ': > /usr/include/plib/ul.h:399: error: cannot convert `float*' to `short=20 > int*' for > argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `void ulEndianBigArray32(unsigned=20 > int*, > int)': > /usr/include/plib/ul.h:419: error: cannot convert `unsigned int*' to=20 > `short > int*' for argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `void=20 > ulEndianBigArrayFloat(float*, int)': > /usr/include/plib/ul.h:429: error: cannot convert `float*' to `short=20 > int*' for > argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `unsigned int=20 > ulEndianBig32(unsigned int)': > /usr/include/plib/ul.h:447: error: cannot convert `unsigned int*' to=20 > `short > int*' for argument `1' to `void ulEndianSwap(short int*)' > /usr/include/plib/ul.h: In function `float ulEndianBigFloat(float)': > /usr/include/plib/ul.h:456: error: cannot convert `float*' to `short=20 > int*' for > argument `1' to `void ulEndianSwap(short int*)' > In file included from /usr/include/plib/fnt.h:29, > from /usr/include/plib/pu.h:28, > from MePSim.C:9: > /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 > (*)[4], const > float*, const float*)': > /usr/include/plib/sg.h:149: error: declaration of C function `void > sgMakeCoordMat4(float (*)[4], const float*, const float*)'=20 > conflicts with > /usr/include/plib/sg.h:146: error: previous declaration `void > sgMakeCoordMat4(float (*)[4], float, float, float, float, float,=20 > float)' > here > /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 > (*)[4], const > float*, const float*)': > /usr/include/plib/sg.h:151: error: cannot convert `const float' to `con= st > float*' for argument `2' to `void sgMakeCoordMat4(float (*)[4], cons= t > float*, const float*)' > /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 > (*)[4], const > sgCoord*)': > /usr/include/plib/sg.h:155: error: declaration of C function `void > sgMakeCoordMat4(float (*)[4], const sgCoord*)' conflicts with > /usr/include/plib/sg.h:149: error: previous declaration `void > sgMakeCoordMat4(float (*)[4], const float*, const float*)' here > /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 > (*)[4], const > float*, const float*)': > /usr/include/plib/sg.h:156: error: cannot convert `const float*' to=20 > `const > sgCoord*' for argument `2' to `void sgMakeCoordMat4(float (*)[4],=20 > const > sgCoord*)' > . > . > . > > I would be most grateful for any suggestions. Thanks again, |
From: Bernhard W. <bw...@ca...> - 2004-10-23 12:37:48
|
> extern "C" { > #include "plib/ul.h" > #include "plib/sg.h" > } > > -Fred Unfortunately that doesn't work either. These headers are written using C++. For some (unknown) reason, the=20 compiler thinks that they are written in C, then tries to read them as=20= C and finally complains because he cannot understand them. -Bernhard > > Bernhard Windisch a =E9crit : > >> Thanks for the immediate reply. >> >>> Bernhard Windisch wrote: >>> >>>> I have written a glut-application and compiled it on Mac OS X NOT=20= >>>> using the project development tools but the g++ compiler. >>>> Now, I decided to design the user interface using pui but even just=20= >>>> including the headerfile without actually using anything from the=20= >>>> library creates real problems because the (standard) g++-3.3=20 >>>> compiler doesn't recognise the plib files as C++ and is therefore=20= >>>> not able to compile. >>> >>> >>> If it isn't able to compile your application with the PLIB headers=20= >>> in them >>> then the problem is not how it recognises PLIB's files - but rather=20= >>> a matter >>> of what language it thinks the application is written in...header=20 >>> fines have >>> to match the language of the file they are included into. >>> >> >> It is completely right that the compiler doesn't recognise the=20 >> language of pu.h. The problem is that the application IS indeed=20 >> written in C++ and has been compiled using g++-3.3 without any=20 >> problems as long as I don't include the header pu.h. >> >> >>> Could you send us the EXACT output from the compiler? >> >> >> Sure, here it is (though only the first few lines because the problem=20= >> becomes evident and the whole takes up about ten pages... >> >> chopin:~/myProgs/MePSim/puiVersion1 bernhardwindisch$ make >> g++ -g -I/usr/include/gcc/darwin/3.3/c++ -c MePSim.C >> In file included from /usr/include/plib/sg.h:29, >> from /usr/include/plib/fnt.h:29, >> from /usr/include/plib/pu.h:28, >> from MePSim.C:9: >> /usr/include/plib/ul.h: In function `void ulEndianSwap(short unsigned=20= >> int*)': >> /usr/include/plib/ul.h:336: error: declaration of C function `void >> ulEndianSwap(short unsigned int*)' conflicts with >> /usr/include/plib/ul.h:327: error: previous declaration `void >> ulEndianSwap(unsigned int*)' here >> /usr/include/plib/ul.h: In function `void ulEndianSwap(float*)': >> /usr/include/plib/ul.h:342: error: declaration of C function `void >> ulEndianSwap(float*)' conflicts with >> /usr/include/plib/ul.h:336: error: previous declaration `void >> ulEndianSwap(short unsigned int*)' here >> /usr/include/plib/ul.h: In function `void ulEndianSwap(unsigned=20 >> int*)': >> /usr/include/plib/ul.h:342: error: cannot convert `unsigned int*' to=20= >> `float*' >> for argument `1' to `void ulEndianSwap(float*)' >> /usr/include/plib/ul.h: In function `void ulEndianSwap(int*)': >> /usr/include/plib/ul.h:343: error: declaration of C function `void >> ulEndianSwap(int*)' conflicts with >> /usr/include/plib/ul.h:342: error: previous declaration `void >> ulEndianSwap(float*)' here >> /usr/include/plib/ul.h: In function `void ulEndianSwap(short int*)': >> /usr/include/plib/ul.h:344: error: declaration of C function `void >> ulEndianSwap(short int*)' conflicts with >> /usr/include/plib/ul.h:343: error: previous declaration `void >> ulEndianSwap(int*)' here >> /usr/include/plib/ul.h: In function `unsigned int=20 >> ulEndianLittle32(unsigned >> int)': >> /usr/include/plib/ul.h:360: error: cannot convert `unsigned int*' to=20= >> `short >> int*' for argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `float=20 >> ulEndianLittleFloat(float)': >> /usr/include/plib/ul.h:369: error: cannot convert `float*' to `short=20= >> int*' for >> argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `void=20 >> ulEndianLittleArray32(unsigned int*, >> int)': >> /usr/include/plib/ul.h:389: error: cannot convert `unsigned int*' to=20= >> `short >> int*' for argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `void=20 >> ulEndianLittleArrayFloat(float*, int) >> ': >> /usr/include/plib/ul.h:399: error: cannot convert `float*' to `short=20= >> int*' for >> argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `void ulEndianBigArray32(unsigned=20= >> int*, >> int)': >> /usr/include/plib/ul.h:419: error: cannot convert `unsigned int*' to=20= >> `short >> int*' for argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `void=20 >> ulEndianBigArrayFloat(float*, int)': >> /usr/include/plib/ul.h:429: error: cannot convert `float*' to `short=20= >> int*' for >> argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `unsigned int=20 >> ulEndianBig32(unsigned int)': >> /usr/include/plib/ul.h:447: error: cannot convert `unsigned int*' to=20= >> `short >> int*' for argument `1' to `void ulEndianSwap(short int*)' >> /usr/include/plib/ul.h: In function `float ulEndianBigFloat(float)': >> /usr/include/plib/ul.h:456: error: cannot convert `float*' to `short=20= >> int*' for >> argument `1' to `void ulEndianSwap(short int*)' >> In file included from /usr/include/plib/fnt.h:29, >> from /usr/include/plib/pu.h:28, >> from MePSim.C:9: >> /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 >> (*)[4], const >> float*, const float*)': >> /usr/include/plib/sg.h:149: error: declaration of C function `void >> sgMakeCoordMat4(float (*)[4], const float*, const float*)'=20 >> conflicts with >> /usr/include/plib/sg.h:146: error: previous declaration `void >> sgMakeCoordMat4(float (*)[4], float, float, float, float, float,=20= >> float)' >> here >> /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 >> (*)[4], const >> float*, const float*)': >> /usr/include/plib/sg.h:151: error: cannot convert `const float' to=20 >> `const >> float*' for argument `2' to `void sgMakeCoordMat4(float (*)[4],=20 >> const >> float*, const float*)' >> /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 >> (*)[4], const >> sgCoord*)': >> /usr/include/plib/sg.h:155: error: declaration of C function `void >> sgMakeCoordMat4(float (*)[4], const sgCoord*)' conflicts with >> /usr/include/plib/sg.h:149: error: previous declaration `void >> sgMakeCoordMat4(float (*)[4], const float*, const float*)' here >> /usr/include/plib/sg.h: In function `void sgMakeCoordMat4(float=20 >> (*)[4], const >> float*, const float*)': >> /usr/include/plib/sg.h:156: error: cannot convert `const float*' to=20= >> `const >> sgCoord*' for argument `2' to `void sgMakeCoordMat4(float (*)[4],=20= >> const >> sgCoord*)' >> . >> . >> . >> >> I would be most grateful for any suggestions. Thanks again, > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on=20 > ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give=20= > us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out=20= > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users |
From: Frederic B. <fre...@fr...> - 2004-10-23 12:46:46
|
Bernhard Windisch wrote : >> extern "C" { >> #include "plib/ul.h" >> #include "plib/sg.h" >> } >> >> -Fred > > > Unfortunately that doesn't work either. I was not trying to tell you what to do, but warn you about a possible pitfall. You *shouldn't* have this header in an extern "C" clause because they are C++. Perhaps you included them in another header that is in such a clause > These headers are written using C++. For some (unknown) reason, the > compiler thinks that they are written in C, then tries to read them as > C and finally complains because he cannot understand them. -Fred |
From: Bernhard W. <bw...@ca...> - 2004-10-23 12:49:39
|
Sorry, I should read properly... But no that isn't what is happening, -Bernhard On 23 Oct 2004, at 13:46, Frederic Bouvier wrote: > Bernhard Windisch wrote : > >>> extern "C" { >>> #include "plib/ul.h" >>> #include "plib/sg.h" >>> } >>> >>> -Fred >> >> >> Unfortunately that doesn't work either. > > I was not trying to tell you what to do, but warn you about a possible > pitfall. You *shouldn't* have this header in an extern "C" clause > because they > are C++. Perhaps you included them in another header that is in such a > clause > >> These headers are written using C++. For some (unknown) reason, the >> compiler thinks that they are written in C, then tries to read them >> as C and finally complains because he cannot understand them. > > -Fred > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on > ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give > us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users |
From: Steve B. <sjb...@ai...> - 2004-10-23 14:21:13
|
Bernhard Windisch wrote: > It is completely right that the compiler doesn't recognise the language > of pu.h. The problem is that the application IS indeed written in C++ > and has been compiled using g++-3.3 without any problems as long as I > don't include the header pu.h. But think about this - the header file is being '#include'd into the source for your application. The compiler doesn't "recognise the language of pu.h" - it takes the ASCII characters inside that file and inserts them at that point into your application file. Then the resulting ASCII stream is compiled using whatever language the application is written in. The compiler doesn't *see* included files as things to be compiled in their own right. So - it seems that your application is being compiled as C code - and not C++. Perhaps your application code is sufficiently C-like that it's being successfully compiled as C - until you include some header files that are more certainly in C++. Why that should be, I'm not sure. > g++ -g -I/usr/include/gcc/darwin/3.3/c++ -c MePSim.C The '.C' extension (capital C) certainly indicates to the compiler that the code should be C++ - is it possible that something on the Mac is forcing the filename into lowercase before passing it to the compiler??!? Try renaming the source file to .cc or .cxx Another slightly odd thing is that the first error the compiler notices is: > /usr/include/plib/ul.h: In function `void ulEndianSwap(short unsigned int*)': > /usr/include/plib/ul.h:336: error: declaration of C function `void > ulEndianSwap(short unsigned int*)' conflicts with > /usr/include/plib/ul.h:327: error: previous declaration `void > ulEndianSwap(unsigned int*)' here ...well, there are a LOT of C++ language features earlier in ul.h that ought to have been flagged by the compiler if it thought it was compiling C. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |