Error when linking Wesnoth
Moderator: Forum Moderators
Error when linking Wesnoth
Hello to everyone,
In order to start editing Wesnoth source code, I have tried to compile it. I had no problem if I compile Wesnoth without the Test option in CMake, but when I perform the same action with Test option enabled I get the following error:
Does anyone know what could be happening? I am compiling the master branch in Linux.
Thank you in advance
In order to start editing Wesnoth source code, I have tried to compile it. I had no problem if I compile Wesnoth without the Test option in CMake, but when I perform the same action with Test option enabled I get the following error:
Code: Select all
[ 98%] Linking CXX executable ../test
libwesnoth-gui_widget.a(combobox.cpp.o): In function `gui2::tdrop_down_list::tdrop_down_list(SDL_Rect, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int, bool)':
/home/pablos/Desarrollo/kdevelop/wesnoth/src/gui/dialogs/drop_down_list.hpp:30: undefined reference to `vtable for gui2::tdrop_down_list'
libwesnoth-gui_widget.a(combobox.cpp.o): In function `gui2::tdrop_down_list::~tdrop_down_list()':
/home/pablos/Desarrollo/kdevelop/wesnoth/src/gui/dialogs/drop_down_list.hpp:23: undefined reference to `vtable for gui2::tdrop_down_list'
collect2: error: ld returned 1 exit status
src/CMakeFiles/test.dir/build.make:1029: recipe for target 'test' failed
make[2]: *** [test] Error 1
CMakeFiles/Makefile2:852: recipe for target 'src/CMakeFiles/test.dir/all' failed
make[1]: *** [src/CMakeFiles/test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
libwesnoth-gui_widget.a(combobox.cpp.o): In function `gui2::tdrop_down_list::tdrop_down_list(SDL_Rect, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int, bool)':
/home/pablos/Desarrollo/kdevelop/wesnoth/src/gui/dialogs/drop_down_list.hpp:30: undefined reference to `vtable for gui2::tdrop_down_list'
libwesnoth-gui_widget.a(combobox.cpp.o): In function `gui2::tdrop_down_list::~tdrop_down_list()':
/home/pablos/Desarrollo/kdevelop/wesnoth/src/gui/dialogs/drop_down_list.hpp:23: undefined reference to `vtable for gui2::tdrop_down_list'
collect2: error: ld returned 1 exit status
src/CMakeFiles/wesnoth.dir/build.make:144: recipe for target 'wesnoth' failed
make[2]: *** [wesnoth] Error 1
CMakeFiles/Makefile2:345: recipe for target 'src/CMakeFiles/wesnoth.dir/all' failed
make[1]: *** [src/CMakeFiles/wesnoth.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
*** Fallo: Código de salida 2 ***
Thank you in advance
Re: Error when linking Wesnoth
Somebody has made a bad update that broke some inheritance code for dropdown list in the GUI. I failed to find a recent commit that could do it.
What was broken in your case was the target test, which isn't what you need. Try to compile only the target wesnoth and see if the error appears there too.
What was broken in your case was the target test, which isn't what you need. Try to compile only the target wesnoth and see if the error appears there too.
Re: Error when linking Wesnoth
Thak you for your answer! Of course, if I disable the tests there is no problem compiling Wesnoth. However I think I need the tests if I want to be able to collaborate in the project. Am I right? That is my intention.Dugi wrote:What was broken in your case was the target test, which isn't what you need. Try to compile only the target wesnoth and see if the error appears there too.
- Celtic_Minstrel
- Developer
- Posts: 2222
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Error when linking Wesnoth
You can contribute without building the tests. It's better if you can build them, and this problem should certainly still be fixed, but as long as you can build the game itself, that's sufficent. (For the record, I still can't run the tests either.)
Looking at the error, I think this most likely means that the source file defining tdrop_down_list (which I think is src/gui/dialogs/drop_down_list.cpp) is missing from the CMake test build, so perhaps you could even fix it yourself.
Looking at the error, I think this most likely means that the source file defining tdrop_down_list (which I think is src/gui/dialogs/drop_down_list.cpp) is missing from the CMake test build, so perhaps you could even fix it yourself.
Re: Error when linking Wesnoth
I took a quick look and committed a fix which hopefully fixes these issues.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: Error when linking Wesnoth
Thank you for your responses. And thank you shadowm, your commit has fixed the problem and test are compiled now.
By the way, anyone knows how to execute the tests? According to tests help:
but I do not know where these custom test modules are, and in case I run test executable without that parameter it says:
Since the main problem was solved, sould I mark this thread as solved?
By the way, anyone knows how to execute the tests? According to tests help:
Code: Select all
test [Boost.Test argument]... -- [custom test module argument]...
Code: Select all
20160419 22:59:08 error filesystem: Trying to open file with empty name.
20160419 22:59:08 error preprocessor: Could not open file
20160419 22:59:08 error filesystem: Trying to open file with empty name.
20160419 22:59:08 error preprocessor: Could not open file
Re: Error when linking Wesnoth
Those errors (and any other messages output with Wesnoth’s own logging facility in the form
Also, in case you are interested in running individual tests, there is some documentation for the unit tests library we use here; test suites and tests are defined as code in
<timestamp> <log level> <logdomain>: <message>
) are actually normal and expected and don’t necessarily mean that any tests have failed. If a test has failed, the test target will exit with a non-zero status and I believe you will see the source of the error clearly mentioned at the end of the output.Also, in case you are interested in running individual tests, there is some documentation for the unit tests library we use here; test suites and tests are defined as code in
src/tests/
.Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.