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

Author Topic: Export project in VS Code  (Read 1279 times)

0 Members and 1 Guest are viewing this topic.

s4game

  • Newbie
  • *
  • Posts: 11
    • View Profile
Export project in VS Code
« 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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11145
    • View Profile
    • development blog
    • Email
Re: Export project in VS Code
« Reply #1 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
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

s4game

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export project in VS Code
« Reply #2 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11145
    • View Profile
    • development blog
    • Email
Re: Export project in VS Code
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

s4game

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export project in VS Code
« Reply #4 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.
« Last Edit: February 03, 2025, 07:16:11 pm by s4game »