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

Author Topic: Cmake build of SFML only has lib files for debug  (Read 1564 times)

0 Members and 1 Guest are viewing this topic.

ajvdv

  • Newbie
  • *
  • Posts: 1
    • View Profile
Cmake build of SFML only has lib files for debug
« on: September 03, 2020, 08:04:22 am »
Hey, sort of a two part question here.

I have been following this tutorial (https://www.sfml-dev.org/tutorials/2.5/start-vc.php) am getting the error "cannot open source file SFML\Graphics.hpp" when I try and run the example code at the bottom. I am trying to statically link.

I think I have followed the tutorial to the letter, but because I am using Visual studio 2019, I had to build SFML from using CMake. When I build it, The debug .lib files (with -d suffix) were generated, but not the release. I finished the tutorial anyway, just only linking the debug files. Even when trying to run the example in debug mode, I still get the error.

So two questions:
 - Why is my build only giving me the debug libs?
 - Is the lack of release libs the reason why it won't run? (even though I am running on debug mode)

things I have already done
> added the paths to the lib and include folders in VS (globally)
> linked the debug .lib files (along with their dependencies)
> added the SFML_STATIC macro


These are my CMake options


Cheers for any help.
« Last Edit: September 03, 2020, 08:37:03 am by ajvdv »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Cmake build of SFML only has lib files for debug
« Reply #1 on: September 03, 2020, 09:33:23 am »
Quote
Why is my build only giving me the debug libs?
Because you build the Debug configuration in Visual Studio. There's a combo-box to choose the configuration to build. CMAKE_BUILD_TYPE is ignored for Visual Studio, as the IDE is able to handle all the build types from a single solution, directly from the IDE.

Quote
Is the lack of release libs the reason why it won't run?
No, since this is a compile error (lack of libraries would cause a linker error). Most likely, the include path that you configured (globally) is not taken in account.
Laurent Gomila - SFML developer

 

anything