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

Author Topic: I run my cmake SFML example(opengl) the window is displayed and then disappears  (Read 1837 times)

0 Members and 1 Guest are viewing this topic.

TraverseBiTree

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
OS: Windows 10 20H2
CMake gui: 3.20.1
SFML ver: From github

I run all the SFML examples downloaded from offical website , all example programs run ok without problem .

But , when I run my cmake SFML example , except for ftp.exe , sockets.exe , voip.exe (maybe don't use opengl) run normally ,other programs like island.exe , shader.exe , win32.exe (use opengl) run with problem , the window is displayed and then disappears immediately.  Whether SFML_OPENGL_ES option is checked or not and whether the compiler is Mingw or MSVS when I cmake from source .
« Last Edit: April 13, 2021, 05:34:45 pm by TraverseBiTree »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11001
    • View Profile
    • development blog
    • Email
Do you have a dedicated GPU? Did you install the required driver? Are you in a VM?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

TraverseBiTree

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
I run with notebook, i5 9400(integrated gpu) and Nvidia GTX 1650 . I've installed all required drivers and kept updated .Not in a VM .

I run the examples(.exe) downloaded from offical website , all ok .But run the examples I cmaked from source ,the window is displayed and then disappears immediately. :'(

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11001
    • View Profile
    • development blog
    • Email
Ahhh, did you build the INSTALL target?
island, shader, win32, tennis, etc use resources like images or shaders. If they can't be found, the application will just close and output an error message on the terminal.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

TraverseBiTree

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
You helped me very much, thank you very much! I'm so stupid,haha ;D

 

anything