Page 1 of 1

Linking Error

Posted: 23 Oct 2008, 04:11
by Retnur
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?

Re: Linking Error

Posted: 23 Oct 2008, 04:25
by Jaxad0127
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?

Re: Linking Error

Posted: 23 Oct 2008, 07:30
by Bjørn
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.