This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: undefined reference to `x'


Hi guys,
Cheers for all your help. I've tried adding "drawWindow.o" to the linker line but then I get a further similar error, which requires more and more *.o files to be added. Because I am working with software that does compile on other machines I'm guessing this isn't the problem, feel free to correct me

A lot of the followup ask me questions which I don't really understand. I have a reasonable understanding of c++ but when it comes to someone elses code that isn't documented I'm pretty lost! Someone asked how they are declared in the class, is that how they are declared in the header file? If so the yare just declared as public functions.

Someone else asked me if the object files were contained within one of the libraries. I think part of my lack of understanding of c++ is how libraries work. If anyone could point me in the direction of a good tutorial on libraries I might be able to fathum something out.

Thankyou for all your replies, that gave me some ideas and I've spent quite some time trying out what you have said. Any other help would be really appreciated
Alex





----------------------------------------
> From: ikrabbe.ask@web.de
> To: gcc-help@gcc.gnu.org
> Subject: Re: undefined reference to `x'
> Date: Wed, 2 Aug 2006 22:32:12 +0200
> CC: alextriffitt@hotmail.com
> 
> Am Mittwoch, 2. August 2006 18:19 schrieb Alex Triffitt:
> > [...]
> >
> > g++ -g -o iNSpect configFile.o eventBuilder.o vizNodeList.o vizNode.o
> > vizLine.o iNSpect.o vizProperties.o simWindow.o toolkitWindow.o
> > vizManager.o nodeStats.o -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
> > -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0
> > -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0   -Wl,--export-dynamic
> > -lgtkglext-x11-1.0 -lgdkglext-x11-1.0 -lGLU -lGL -lgtk-x11-2.0 -lpangox-1.0
> > -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0
> > -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
> >
> > I get the following error;
> >
> > vizManager.o: In function
> > `~vizManager':/home/triff/inspect-triff-beta/src/vizManager.cpp:99:
> > undefined reference to `drawWindow::~drawWindow()'
> > [...]
> 
> Well, you should examine where the drawWindow class is or should be defined.  
> Most usefully it would live in file like drawWindow.cpp which then should 
> compile into drawWindow.o and should then be added to the linker line above.
> 
> What's about toolkitWindow.o ?  Anyway as I assume from the layout of your 
> errors, drawWindow is a locally defined object, which should live somewhere 
> near your code.  Or should it be in some library ?
> 
> You may just have forgotten object file or libary.  Try to find out which.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]