Hi! I am currently working on a project using sfml. I am making a mainmenu with sf::Text and using
this->title->setFillColor
which works on OS X.
I have been developing on OS X and the code runs fine, but when im trying to run the code on my computer, which is running Elementary OS in VM, the code comes with an error:
CMakeFiles/Project.dir/Source_Files/States/stateMainMenu.cpp.o: In function `stateMainMenu::render(sf::RenderWindow*)':
/home/richchigga/Project/Source Files/States/stateMainMenu.cpp:90: undefined reference to `sf::Text::setFillColor(sf::Color const&)'
/home/richchigga/Project/Source Files/States/stateMainMenu.cpp:91: undefined reference to `sf::Text::setFillColor(sf::Color const&)'
/home/richchigga/Project/Source Files/States/stateMainMenu.cpp:92: undefined reference to `sf::Text::setFillColor(sf::Color const&)'
/home/richchigga/Project/Source Files/States/stateMainMenu.cpp:93: undefined reference to `sf::Text::setFillColor(sf::Color const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/Project.dir/build.make:510: recipe for target 'Project' failed
make[3]: *** [Project] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Project.dir/all' failed
make[2]: *** [CMakeFiles/Project.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/Project.dir/rule' failed
make[1]: *** [CMakeFiles/Project.dir/rule] Error 2
Makefile:118: recipe for target 'Project' failed
make: *** [Project] Error 2
When changing the code to
this->title->setColor(sf::Color::Blue);
it runs fine.
Please help, i can not seem to find the problem.
If you have further questions, just ask.
Thanks in advance!