I'm just recently came to know the existence of SFML and I wanted to try it out !
So I followed the instructions from the SFML Github Wiki using Cmake with Clion on Windows
Here's where I installed SFML : `C:\SFML`
Here's the layout of my Clion project folder :
http://prntscr.com/ezgo1nHere's the content of my `main.cpp`:
#include "config.h"
#define SFML_STATIC
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main()
{
sf::Window w(sf::VideoMode(800,600),"da");
return 0;
}
Here's the content of the `config.h.in` file:
#define Adventures_VERSION_MAJOR @Adventures_VERSION_MAJOR@
#define Adventures_VERSION_MINOR @Adventures_VERSION_MINOR@
Here's the content of my `CMakeLists.txt`:
https://pastebin.com/2QQCycEvAnd finally here's the error I got :
"C:\Program Files (x86)\JetBrains\CLion 2016.3.2\bin\cmake\bin\cmake.exe" --build C:\Users\user\Documents\Projects\Adventures\cmake-build-debug --target Adventures -- -j 4
[ 50%] Linking CXX executable Adventures.exe
CMakeFiles\Adventures.dir/objects.a(main.cpp.obj): In function `main':
C:/Users/user/Documents/Projects/Adventures/main.cpp:10: undefined reference to `sf::String::String(char const*, std::locale const&)'
C:/Users/user/Documents/Projects/Adventures/main.cpp:10: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
C:/Users/user/Documents/Projects/Adventures/main.cpp:10: undefined reference to `sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
C:/Users/user/Documents/Projects/Adventures/main.cpp:10: undefined reference to `sf::Window::~Window()'
C:/Users/user/Documents/Projects/Adventures/main.cpp:10: undefined reference to `sf::Window::~Window()'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\Adventures.dir\build.make:101: recipe for target 'Adventures.exe' failed
mingw32-make.exe[3]: *** [Adventures.exe] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/Adventures.dir/all' failed
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/Adventures.dir/rule' failed
mingw32-make.exe[2]: *** [CMakeFiles/Adventures.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles/Adventures.dir/rule] Error 2
Makefile:183: recipe for target 'Adventures' failed
mingw32-make.exe: *** [Adventures] Error 2
And I can't seem to figure it out... I've looked all over stackoverflow, the forums, nothing fixed it
Any clue ?
[1]:
https://github.com/SFML/SFML/wiki/Tutorial%3A-Build-your-SFML-project-with-CMake