How to build in Linux Ubuntu the debug and release versions in Visual Studio 2022 #8258
TimofteBogdan1900
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have some updates for those who are interested in building an Ubuntu WSL application using Visual Studio 2022. There is a file called CMakePresets.json in the root of the project, which contains configurations for both debug and release builds that should be selectable from a drop-down menu in Visual Studio 2022. However, for some reason, this feature does not work as intended and the 'Linux Debug' configuration is selected by default. This results in the debug variant being built, which can cause the application to crash with an error when attempting to load a game:
The error above is not sure if intended or developer error . But anyway we want a release elf executable which shouldnt have all these asserts !
Since I wanted to build the release variant of the application in Visual Studio 2022, I was unable to find a solution other than to delete the existing CMakePresets.json file and create two new configurations ('debug' and 'release') using the GUI
The file now contains
Please note that when you add the new 'debug' and 'release' configurations, it may cause the SSH connection between Visual Studio 2022 and the WSL Linux system to break. To fix this issue, you'll need to recreate the connection.
First, you'll need to stop the SSH server and edit the configuration file using the command 'sudo nano /etc/ssh/sshd_config'. You should then enable password-based authentication in the configuration file, and start the SSH server again.
After that, you can add a new remote connection in Visual Studio 2022 with the following settings: 'localhost' as the hostname, your username, and the root password. Once this is done, you should be able to build the release version of the application without encountering any crashes
To run the release variant here is an example .
build in visual studio GCC release variant and then open WSL

run in WSL these commands to ensure the release elf exists
./pcsx2-qtTo build the windows exe variant just select debug or release for the 64 bit platform

To summarize, once you have created the necessary configurations in CMakePresets.json, you can switch between the debug and release variants in Visual Studio 2022 by selecting the appropriate configuration from the drop-down menu. You don't need to delete any files to make this work.
Additionally, if you are working on a project that uses Git, you can easily switch between Windows and Linux variants and quickly get the latest changes by using git pull. With the help of Visual Studio 2022 and WSL, you can easily build your code in both Windows and Linux environments, making development more efficient and streamlined.
Ps: the vulkan and opengl performance in WSL2 is shit though due to missing native drivers :)
Beta Was this translation helpful? Give feedback.
All reactions