Linking Error

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
Retnur
Peon
Peon
Posts: 1
Joined: Thu Oct 23, 2008 5:08 am

Linking Error

Post by Retnur » Thu Oct 23, 2008 5:11 am

I've got all the required libraries installed, but I'm getting a linking error after I make on the newest source:
/root/tmw/src/game.cpp:278: undefined reference to `PostHandler::PostHandler()'
/root/tmw/src/game.cpp:278: undefined reference to `PostHandler::PostHandler()'
I can't find that it is defined in the code. (And only 2 or 3 places it's even referenced.)

I have to assume it has to be part of an included library.

Can anyone tell me what this class is and what can I do to clear up this error?
User avatar
Jaxad0127
TMW Adviser
TMW Adviser
Posts: 4209
Joined: Thu Nov 01, 2007 6:35 pm
Location: Internet

Re: Linking Error

Post by Jaxad0127 » Thu Oct 23, 2008 5:25 am

Retnur wrote:I've got all the required libraries installed, but I'm getting a linking error after I make on the newest source:
/root/tmw/src/game.cpp:278: undefined reference to `PostHandler::PostHandler()'
/root/tmw/src/game.cpp:278: undefined reference to `PostHandler::PostHandler()'
I can't find that it is defined in the code. (And only 2 or 3 places it's even referenced.)

I have to assume it has to be part of an included library.

Can anyone tell me what this class is and what can I do to clear up this error?
Are the files up-to-date?
Image
User avatar
Bjørn
TMW Adviser
TMW Adviser
Posts: 1430
Joined: Thu Dec 09, 2004 7:50 pm
Location: North Rhine-Westphalia, Germany
Contact:

Re: Linking Error

Post by Bjørn » Thu Oct 23, 2008 8:30 am

Uh, first off, it is really not a good idea to work as root. You don't need to be root to compile TMW, so I would suggest you do so as a normal user. This is because whatever you do as root can affect your whole system, and so it can also potentially mess it up.

In your case, the src/Makefile.am file was out of date and didn't include posthandler.{h,cpp}. I've added these now and committed it in revision 4762. It is common in this project that some files are missing from a build system, since not all developers use the same. Some use cmake, some configure, and some Code::Blocks. We can't all be bothered to keep everything up to date when adding files. So better learn to recognize these kind of errors. :)

Though maybe it would be better if we required everybody to keep at least Makefile.am updated... since it is our primary target and our release mechanism relies on it.
Post Reply