SFML community forums

Help => General => Topic started by: s4game on January 29, 2025, 05:40:24 pm

Title: Export project in VS Code
Post by: s4game on January 29, 2025, 05:40:24 pm
Good day.
I have made a little project using VS Code in C++ CMake on Windows 10. While there are guides for release using Visual Studio Community, seems to be none for VS Code. How can one export their project there?

Thanks in advance
Title: Re: Export project in VS Code
Post by: eXpl0it3r on January 30, 2025, 08:36:02 am
Depends what you want to define as "release".

You could add install commands to your CMake script, so if you build the install target, it would copy all the necessary files to the destination.
Simpler yet, you could just run the CMake: Release command, which builds your application in release mode and then you can copy the files manually and maybe put them in a ZIP file.
You could also use CMake's CPack to create an installer
Title: Re: Export project in VS Code
Post by: s4game on January 30, 2025, 02:08:50 pm
There seems to be no CMake: Release command when looking through CMake commands. Maybe it has a different name?
Title: Re: Export project in VS Code
Post by: eXpl0it3r on January 30, 2025, 03:13:01 pm
Ah right, I confused myself ;D

The command in the command palette to use is "CMake: Select Variant" (which only shows up if don't have a preset).
There you can select a release build and then simply build your application in Release mode.
Title: Re: Export project in VS Code
Post by: s4game on February 03, 2025, 07:12:22 pm
I'm sorry for taking so long to reply. After building in the release mode, 3 executables are present in the ./build folder. Two are named 'a.exe', those do not launch, the other is 'main.exe' that is supposedly the project's executable. After launching the file CMD appears along with an error message box, saying that some obscure procedure was not found in the DLL library. Am I doing something wrong? I believe the same error used to appear even before I built my project using the release mode.