SFML community forums
Help => General => Topic started by: abisi on November 21, 2016, 07:19:52 pm
-
Hello,
I do not really know how to address this request for help, as I am very new and unexperienced in programming and informatics. Yet my assistants are unable to help me at school so I am turning to the community.
I am doing a project in one of my course. We are a group of 11 people in the same project, and we use git to work on this project. One of my partner coded classes, methods, a big piece of code with SFML. I have installed myself SFML but when I try to build with cmake . , the generating is done. Yet when I do 'make', it seems that some functionalities of SFML are unfound, as I get the following error. (I must precise that this does not appear on my partner's computer, we both use Mac - I think someone installed SFML for her).
The message reads Logo, Axes which are classes coded by my partner. The first line brings to a method of SFML that is not found, I believe ?
I must say that any kind of help would be more than helpful, as this prevents me from executing my main and working on my project. I am sure that you might need some more informations in order to help me, I am very responsive so feel free to ask.
Precisions :
I am using Mac OS, Geany as editor, CMake, coding in C++.
(The picture should be included.)
-
Hi
First, please don't create useless polls... then check your post and you'll see that your TIFF image doesn't show. Please use a more common format (PNG), or even better: copy-paste the errors as text.
-
Of course, it's just that I did not know how to provide the necessary informations or which informations.
Here is the error I get while making :
[ 14%] Linking CXX executable Main
Undefined symbols for architecture x86_64:
"sf::Font::loadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
Logo::afficher_logo(std::vector<Motif, std::allocator<Motif> >) in Logo.cpp.o
"sf::String::String(char const*, std::locale const&)", referenced from:
Logo::afficher_logo(std::vector<Motif, std::allocator<Motif> >) in Logo.cpp.o
"sf::Texture::loadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sf::Rect<int> const&)", referenced from:
Logo::Logo() in Logo.cpp.o
Logo::Logo() in Logo.cpp.o
Axes::Axes() in Axes.cpp.o
Axes::Axes() in Axes.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [Main] Error 1
make[1]: *** [CMakeFiles/Main.dir/all] Error 2
make: *** [all] Error 2
Again, Logo and Axes are classes created by someone in my group. Yet I do not understand why CMake does not find (if indeed it means that it does not find) the methods in Font.
Thanks again for all kind of help I should receive.
-
When compiling your project, make sure to use the same tools that were used to compile SFML. I.e. the same brand of compiler & std lib. Recompiling SFML to match your environment is also an option.
-
Hello,
Thank you for answer.
I am using CMake and my CMakeLists.txt should include SFML. My project contains the cmake module FindSFML.cmake so that it knows where to find SFML. (Is that correct ?) From then I do not understand what I should do, as I compile on the terminal. So how could I compile SFML in order to match my environment, for example, from the terminal ?
-
Compiling SFML has nothing to do with how your project is compiled. It's really a separate process. Have a look at the tutorial: http://www.sfml-dev.org/tutorials/2.4/compile-with-cmake.php