ChristophHaag / SteamVR-OpenHMD

SteamVR plugin for using OpenHMD drivers in SteamVR
Boost Software License 1.0
195 stars 32 forks source link

fail to run on macOS, possibly because lack of 32bit support #55

Open Willian-Zhang opened 3 years ago

Willian-Zhang commented 3 years ago

build info

[ 86%] Linking C static library libopenhmd.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libopenhmd.a(platform-win32.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libopenhmd.a(platform-win32.c.o) has no symbols
[ 86%] Built target openhmd
[ 89%] Building CXX object CMakeFiles/driver_openhmd.dir/driverlog.cpp.o
[ 91%] Building CXX object CMakeFiles/driver_openhmd.dir/driver_openhmd.cpp.o
[ 94%] Linking CXX shared library bin/osx64/driver_openhmd.dylib
[ 94%] Built target driver_openhmd
[ 97%] Building C object subprojects/openhmd/examples/simple/CMakeFiles/simple.dir/simple.c.o
[100%] Linking C executable simple
[100%] Built target simple
# In ~/Library/Application Support/Steam/steamapps/common/SteamVR
❯ find . -name "vrpathreg"
./SteamVR.app/Contents/MacOS/runtime/bin/osx32/vrpathreg

❯ ./SteamVR.app/Contents/MacOS/runtime/bin/osx32/vrpathreg
Runtime path = /Users/macuser/Library/Application Support/Steam/steamapps/common/SteamVR/SteamVR.app/Contents/MacOS/runtime/
Config path = /Users/macuser/Library/Application Support/Steam/config
Log path = /Users/macuser/Library/Application Support/Steam/logs
External Drivers:
    /Users/macuser/Github/other/SteamVR-OpenHMD/build

from vrserver.txt

Sun Feb 14 2021 02:24:32.100611 - Unable to load driver openhmd from /Users/macuser/Github/other/SteamVR-OpenHMD/build/bin/osx32/driver_openhmd.dylib.
Sun Feb 14 2021 02:24:32.100651 - Unable to load driver openhmd because of error VRInitError_Init_FileNotFound(103). Skipping.

FTR osx32 does not exist in /Users/macuser/Github/other/SteamVR-OpenHMD/build/bin

if ln -s osx64 osx32

from vrserver.txt

Sun Feb 14 2021 01:47:10.429747 - error VRInitError_Init_InterfaceNotFound when initing driver openhmd from /Users/macuser/Github/other/SteamVR-OpenHMD/build/bin/osx32/driver_openhmd.dylib.
if add Compile flags

Neither openhmd nor this project was familiar to me, just tried the following with random guessing:

set(CMAKE_C_FLAGS -m32)
set(CMAKE_CXX_FLAGS -m32)
set_target_properties(openhmd PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
set_target_properties(driver_openhmd PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
build info
[ 86%] Linking C static library libopenhmd.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libopenhmd.a(platform-win32.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libopenhmd.a(platform-win32.c.o) has no symbols
[ 86%] Built target openhmd
[ 89%] Building CXX object CMakeFiles/driver_openhmd.dir/driverlog.cpp.o
[ 91%] Building CXX object CMakeFiles/driver_openhmd.dir/driver_openhmd.cpp.o
[ 94%] Linking CXX shared library bin/osx64/driver_openhmd.dylib
... (large chunks of c lines)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/osx64/driver_openhmd.dylib] Error 1
make[1]: *** [CMakeFiles/driver_openhmd.dir/all] Error 2
make: *** [all] Error 2