Re: [Plib-users] link plib into code on mac osx
Brought to you by:
sjbaker
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 |