c++ - How to run SFML in CLion, Error undefined reference to? -


I am new to C ++ and am trying to learn game programming, I choose SFML and JLRN Run on Jetren and using the Ubuntu machine. I am following this tutorial of my code:

  #include & lt; Sfml / graphics HP & gt; Using namespace sf; Int main () {Render window window (SF :: VideoDoode (200, 200), "SFML Work!"); Circle size figure (100.F); Shape.setFillColor (Color: Green); While (window.isOpen ()) {event event; While (window.pollEvent (event)) {if (event.type == event :: off) {window.close (); }} Window.clear (); Window.draw (size); window display(); } Return 0; }  

When I run an error on CLion

  CMakeFiles / SFMLBasic.dir / main.cpp.o: function in `main ': undefined reference` SF :: String :: String (Four Constant *, STD :: LocalCont & amp;;) SF :: Video: :: For the SF :: for the undefined reference to the Video Mode (unsigned int, unsigned integer, unsigned ind) Undetermined Reference RenderWindow :: RenderWindow (sf :: VideoMode, sf :: String Contest & Unsigned Int, SF :: Conte Cost Settings ... & amp; ... ... Undefined Reference for SF :: Size: ~ Size () ' 

I configured the SFML to run in the clone Or how do I set up, I do not know that CMKE can do this? I am run only by terminal, This works if I run this command.

 < Code> G ++ -c main.cpp g ++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system ./sfml-app  

terminal In manually without any manual How to config to use Drb variable? Thank you.

You need to link to the SFML library in your CMakeLists.txt.

Take a look at CMake.

And it can be helpful to know how to get the SFML library path in CMK.

Here is a FindSFML.cmake module:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -