You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
xxx@DESKTOP-2S2KVAJ:~/.vs/pcsx2/bf1614cd-704d-4fc4-98f5-d6da357085bf/out/build/Linux-GCC-Release/bin$ ls
logs pcsx2-qt resources
run the exe with ./pcsx2-qt
you should see
xxx@DESKTOP-2S2KVAJ:~/.vs/pcsx2/bf1614cd-704d-4fc4-98f5-d6da357085bf/out/build/Linux-GCC-Release/bin$ ./pcsx2-qt
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Program Path: /home/xxx/.vs/pcsx2/bf1614cd-704d-4fc4-98f5-d6da357085bf/out/build/Linux-GCC-Release/bin/pcsx2-qt
AppRoot Directory: /home/xxx/.vs/pcsx2/bf1614cd-704d-4fc4-98f5-d6da357085bf/out/build/Linux-GCC-Release/bin
DataRoot Directory: /home/xxx/.config/PCSX2
....
To 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 :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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-qt
To 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