Re: [Plib-users] error with gcc after including fnt header
Brought to you by:
sjbaker
From: Victor h. <na...@ho...> - 2011-01-29 15:54:21
|
Thank you so much; i tried to figure it out after i've posted... Thanks again Victor Date: Sat, 29 Jan 2011 07:59:19 -0600 From: joh...@cy... To: pli...@li... Subject: Re: [Plib-users] error with gcc after including fnt header Victor, Hello and welcome to the PLIB community. I wish you a good a productive time here. The basic problem is that your program is written in C (the ".c" extension means that GCC will use the C compiler on it) while PLIB is written in C++. To give one example, if you will look in the file "sg.h" (in the "src/sg" directory) on lines 436 and 457 you will find two definitions of the function "sgScaleVec3". They have different argument lists; C++ is able to distinguish between them based on the argument lists, but C is not. Unfortunately there isn't much to do about it beyond redoing your program in C++. You may not need to redo the entire program (depending on its size), but any part that uses a PLIB library will need to be in C++. You could write a wrapper function in a separate file with a ".cxx" or ".cpp" or ".cc" extension and preface your function definitions with the string extern "C" which will tell the C++ compiler that these functions will be called from C language functions. - John On 1/28/2011 11:08 PM, Victor henri wrote: Hello I would like to use plib fnt to use some text, in a 3D spectral analysis of the sound that works fine already (openGL in a SDL window). The problem is : when I add the include file #include <plib/fnt.h>,i get a huge error message that i've attached in a file (it is so big that I don't even have the beginning in my terminal). I'm on ubuntu Maverick 10.10 64 bits; plib hab been installed from the official packages (i've installed the libplib-dev package also); I compile my program with that command : gcc -o Spectrum `pkg-config gstreamer-0.10 --cflags --libs` `pkg-config gtk+-2.0 --cflags --libs` `sdl-config --cflags --libs` -lGLU -lGL -lglut -lplibfnt -lplibsg -lglut -L/usr/X11/lib -lX11 -lXext -lXmu -lm `pkg-config jack --cflags --libs` myProgram.c Before I add the fnt header,the compilation is succesfull with this command; it's only after adding the fnt.h that problems arrive; i understand that it is not necessary to include the sg header for it is called by the fnt (anyway i've trid that also). Could please anyone give me a clue? Thank you Victor ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ plib-users mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-users ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ plib-users mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-users |