ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
There is less than 24 hours left to vote in the 2015 LinuxQuestions.org Members Choice Awards. Click here to go to the polls. Vote now and make sure your voice is heard!
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have some problems when I try to compile programs wherein I use the PLIB (http://plib.sourceforge.net/index.html). So I tried to compile one of the sample programs that go with it, and I get the same undefined reference errors. Am I specifying the wrong compiler options? This is what happens:
$ g++ -g -Wall -I/usr/include -L/usr/lib -lglut -lGL -lGLU -L/usr/X11/lib -lX11 -lXext -lXmu -lm -L/usr/lib -lplibpu -lplibfnt -lplibsg -lplibul -o simple simple.cxx
/tmp/cccdQIhC.o: In function `displayfn()':
/home/jp/downloads/plib_examples-1.8.4/src/pui/simple.cxx:66: undefined reference to `puDisplay()'
/tmp/cccdQIhC.o: In function `mousefn(int, int, int, int)':
/home/jp/downloads/plib_examples-1.8.4/src/pui/simple.cxx:57: undefined reference to `puMouse(int, int, int, int)'
/tmp/cccdQIhC.o: In function `motionfn(int, int)':
/home/jp/downloads/plib_examples-1.8.4/src/pui/simple.cxx:51: undefined reference to `puMouse(int, int)'
/tmp/cccdQIhC.o: In function `puInitGLUT()':
/usr/include/plib/puGLUT.h:66: undefined reference to `puSetWindowFuncs(int (*)(), void (*)(int), void (*)(int*, int*), void (*)(int, int))'
/usr/include/plib/puGLUT.h:67: undefined reference to `puRealInit()'
/tmp/cccdQIhC.o: In function `puButton':
/usr/include/plib/pu.h:1031: undefined reference to `puObject:uObject(int, int, int, int)'
/usr/include/plib/pu.h:1031: undefined reference to `vtable for puButton'
/tmp/cccdQIhC.o: In function `puOneShot':
/usr/include/plib/pu.h:1053: undefined reference to `vtable for puOneShot'
/tmp/cccdQIhC.o: In function `puObject::setLegend(char const*)':
/usr/include/plib/pu.h:721: undefined reference to `puPostRefresh()'
collect2: ld returned 1 exit status
The source code of the sample program is:
PLIB - A Suite of Portable Game Libraries
Copyright (C) 2001 Steve Baker
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
int main ( int argc, char **argv )
glutInitWindowPosition ( 0, 0 ) ;
glutInitWindowSize ( 640, 480 ) ;
glutInit ( &argc, argv ) ;
/* Note that in order for PUI and this example program to work, you
definitely don't need a depth buffer.
However, most applications using PUI do some more things than rendering
PUI widgets. In every "real" program, you usually do need a depth
buffer - we are requesting one in the next line so that PLIB programmers
can write their applications upon this example code without running
into problems. */
Looks like another library or object needs to be linked in. Rather than frustrate yourself, this is a problem best solved by the project administrator. You should post this question on their help board or email them directly. I'd suggest to them that they provide a makefile with the source code.