Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Creating and configuring a SFML project:  (Read 2843 times)

0 Members and 1 Guest are viewing this topic.

samtheman

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Creating and configuring a SFML project:
« on: May 17, 2018, 12:12:22 am »
I hope you be able to help me create my first SFML project, I been trying a long time now.
I hope you can follow my steps.
This is the built error:
unable to start program C\:SFML-2.5.0\HelloChester\Debug\HelloChester.exe

Below is the way I built the project:
Creating and configuring a SFML program
Windows 10

1. Made a folder name: C:\SFML-2.5.0
2. Made a project: and put it into the folder name: C:\SFML-2.5.0
3. Downloaded Visual C++ (2017)-32 bit and unzip into C:\SFML-2.5.0 folder

4. Project properties:
All configuration
win32
C/C++
Additional Include Directories:
 SFML-2.5.0 >SFML-2.5.0-windows-vc15-32-bit>SFML-2.5.0>include

5. Project properties:
All configuration
win32
Linker
Additional library directories:
C:\SFML-2.5.0\SFML-2.5.0-windows-vc15-32-bit\SFML-2.5.0\lib
6. Project properties:
Release - win32
Linker
Input
Additional dependencies
Sfml-graphics-s.lib
Sfml-window-s.lib
Sfml-audio-s.lib
Sfml-network-s.lib
Sfml-system-s.lib

7. Project properties:
Debug - win32
Linker
Input
Additional dependencies
Sfml-graphics-s-d.lib
Sfml-window-s-d.lib
Sfml-audio-s-d.lib
Sfml-network-s-d.lib
Sfml-system-s-d.lib


8. Project properties:
Debug – win32
C/C++
Preprocessor
Preprocessor definitions:
SFML_STATIC; WIN32; DEBUG; WINDOWS;% (Preprocessor Definitions)











#include <SFML/Graphics.hpp>

int main()
{
   // create the window
   sf::RenderWindow window(sf::VideoMode(800, 600), "My window");

   // run the program as long as the window is open
   while (window.isOpen())
   {
      // check all the window's events that were triggered since the last iteration of the loop
      sf::Event event;
      while (window.pollEvent(event))
      {
         // "close requested" event: we close the window
         if (event.type == sf::Event::Closed)
            window.close();
      }

      // clear the window with black color
      window.clear(sf::Color::Black);

      // draw everything here...
      // window.draw(...);

      // end the current frame
      window.display();
   }

   return 0;
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Creating and configuring a SFML project:
« Reply #1 on: May 17, 2018, 08:28:36 am »
Quote
This is the built error:
unable to start program C\:SFML-2.5.0\HelloChester\Debug\HelloChester.exe
This is not a build error. It just states that it cannot launch the executable, most likely because it was not able to build it. You should have other compiler or linker errors before this one.

After quickly looking at your configuration, I can already tell you that you're missing SFML dependencies in your linker input. As the tutorial states, if you link SFML statically, you must also link all its dependencies.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Creating and configuring a SFML project:
« Reply #2 on: May 17, 2018, 09:13:06 am »
Please stop making duplicated threads. I already pointed you to the tutorial in your last thread and mentioned it in the PM I sent you after deleting your last duplicated post. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything