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