Guide: Orbiter development in Visual Studio 2019

Well, the "best" way is subjective and varies by what a given developer prefers. :) In this case, it comes down to whether you want to build XRSound as part of the Orbiter CMake project or if you'd rather build XRSound separately via its Visual Studio solution.
 
I suppose it's only 6 of them...well you've talked me into it.
 
Hi Dark, can you share your setup for how you build d3d9 too? I followed the same steps however the video tab in orbiter server says "Console mode (no engine loaded)"
Many thanks!
Edit : I reinstalled the SDK . Now I get the option d3d9 optionin the dropdown.
 
Last edited:
Hi folks,
I've experienced issues with the (current?) irrklang dependency with CMake:
It seems that the zip file that is downloaded for the 64bit builds is not correctly unzipped...I think.
It looks like the irrKlang-64bit-1.6.0.zip has a subfolder "irrKlang-64bit-1.6.0/" that is not handles correct in \Sound\XRSound\CMakeLists.txt
If I understand that file correctly, this part
Code:
# ...
if(BUILD64)
    set(IRRKLANG_BIN_DIR ${IRRKLANG_DIR}/bin/winx64-visualStudio)
    set(IRRKLANG_LIB_DIR ${IRRKLANG_DIR}/lib/Winx64-visualStudio)
else()
    # because of a bug in the 32bit version of irrKlang (it has hidden "__MACOSX" dir),
    # CMake does not strip the top-level directory
    string(APPEND IRRKLANG_DIR /irrKlang-1.6.0)

    set(IRRKLANG_BIN_DIR ${IRRKLANG_DIR}/bin/win32-visualStudio)
    set(IRRKLANG_LIB_DIR ${IRRKLANG_DIR}/lib/Win32-visualStudio)
endif()
set(IRRKLANG_LIB ${IRRKLANG_LIB_DIR}/irrKlang.lib)
# ...
handles that for the 32bit version, but (lately?) the 64bit ZIP has this sub-directory too, so shouldn't it be handled there as well?

Like:
Code:
# ...
if(BUILD64)
    # CMake does not strip the top-level directory
    string(APPEND IRRKLANG_DIR /irrKlang-64bit-1.6.0)

    set(IRRKLANG_BIN_DIR ${IRRKLANG_DIR}/bin/winx64-visualStudio)
    set(IRRKLANG_LIB_DIR ${IRRKLANG_DIR}/lib/Winx64-visualStudio)
else()
    # because of a bug in the 32bit version of irrKlang (it has hidden "__MACOSX" dir),
    # CMake does not strip the top-level directory
    string(APPEND IRRKLANG_DIR /irrKlang-1.6.0)

    set(IRRKLANG_BIN_DIR ${IRRKLANG_DIR}/bin/win32-visualStudio)
    set(IRRKLANG_LIB_DIR ${IRRKLANG_DIR}/lib/Win32-visualStudio)
endif()
set(IRRKLANG_LIB ${IRRKLANG_LIB_DIR}/irrKlang.lib)
# ...
But this does not seem to do the job :(
When I manually extract the ZIP contents into \Extern\irrKlang\x64\ it does compile however!



By the way, this is the CMake error I get all the time:
Code:
1> [CMake] Downloading irrKlang from https://www.ambiera.at/downloads/irrKlang-64bit-1.6.0.zip ...
1> [CMake] CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/ExternalProject.cmake:2771 (message):
1> [CMake]   At least one entry of URL is a path (invalid in a list)
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/ExternalProject.cmake:3681 (_ep_add_download_command)
1> [CMake]   CMakeLists.txt:15 (ExternalProject_Add)
1> [CMake] -- Configuring incomplete, errors occurred!
1> [CMake] See also "D:/Programme/Orbiter/orbiter-git-schnepe2/out/build/windows-x64-debug/_deps/irrklang-subbuild/CMakeFiles/CMakeOutput.log".
1> [CMake] 
1> [CMake] CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1000 (message):
1> [CMake]   CMake step for irrklang failed: 1
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1141:EVAL:2 (__FetchContent_directPopulate)
1> [CMake]   C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1141 (cmake_language)
1> [CMake]   C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FetchContent.cmake:1184 (FetchContent_Populate)
1> [CMake]   Sound/XRSound/CMakeLists.txt:20 (FetchContent_MakeAvailable)
1> [CMake] -- Configuring incomplete, errors occurred!
 
Last edited:
I builded yesterday the BackedVC branch with vs2022 both 32bit and 64bit without any problems.
 
I builded yesterday the BackedVC branch with vs2022 both 32bit and 64bit without any problems.
With option ORBITER_BUILD_XRSOUND ON/enabled?
Configuration "windows-x64-debug".
I'm not sure whether this really is a CMake issue, or (again) a git issue, as that usually bites me every time it can :p
 
Update:
Even after a new clean checkout and submodule update, I still get that error when I open the directory with Visual Studio[*]... :(
After that an empty Extern\irrKlang\x64\ folder is created.
What is not what should happen, as the next time CMake thinks it's installed, but it isn't!

[*] Microsoft Visual Studio Community 2019 Version 16.11.32
 
Back
Top