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

Author Topic: Why the examples(.exe) I built by cmake will report errors?  (Read 1677 times)

0 Members and 1 Guest are viewing this topic.

TraverseBiTree

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Why the examples(.exe) I built by cmake will report errors?
« on: April 13, 2021, 03:01:19 pm »
OS: Windows 10 20H2
CMake gui: 3.20.1
SFML ver: From github

I downloaded the zip file from SFML official website and run the example(.exe) , all ok and no error without any dependencies(.dll).


But I cmaked the SFML by myself ,then run the example(.exe), then report errors:”Can't find sfml-system-2.dll, can't find sfml-network-2.dll ...“ .

I wonder why the example program (.exe) downloaded from the official website can be run directly without relying on the library file(.dll), but the program I build or compile depends on the library file(.dll). How can I build or compile them so that I don’t need to put the executable file(.exe) and library files(.dll) together?

Thank you so much anyone can tell me !
« Last Edit: April 13, 2021, 03:03:29 pm by TraverseBiTree »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Why the examples(.exe) I built by cmake will report errors?
« Reply #1 on: April 13, 2021, 03:17:52 pm »
Because they were built with SFML linked statically.
For the audio examples you still need OpenAL32.dll
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
Re: Why the examples(.exe) I built by cmake will report errors?
« Reply #2 on: April 13, 2021, 04:53:06 pm »
Thank you very much. I clicked "SFML_USE_STATIC_STD_LIBS" and it works. ;D

 

anything