-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker error during attempt to build the cabal tests #3
Comments
update to this one... I have now reconfigured my MSYS2 to avoid spaces in my path, and also put the various libraries and DLLs in place so now I have an absolutely stock cabal file for openvr-hs. Same problems as above. Windows 10, ghc 8.0.2 built in the same MSYS2 install, gcc reporting Rev2 built for the MSYS2 project, version 6.3.0 |
Hi Michael! Ah, I have a guess - did you run The bindings expect a particular version of OpenVR (which I probably need to update again, they've been moving fast) - so |
I shall try that right away, and report back. Though it would be really weird for that to affect the above typedef problem wouldn't it? |
Nope. Exactly the same result as before. With that typedef in its original form, openvr-hs fails to build. With that typedef the way I have it to get past that problem, openvr-hs builds fine, but cabal test still fails at the link stage on building minimal.exe with the following errors, which are the same as above as far as I can tell: michaeljones@LongShot MINGW64 ~/Documents/Programming/Haskell/OpenVR/openvr-hs michaeljones@LongShot MINGW64 ~/Documents/Programming/Haskell/OpenVR/openvr-hs |
Incidentally, the error that results from the typedef issue is as follows in case its related: Preprocessing library openvr-hs-0.1.0.0... In file included from cbits\openvr_capi_missing.h:2:0: error: cbits\openvr_capi_fixed.h:48:14: error: |
Okay, any further advice? It appears that I'm still getting this error having just re-downloaded and built your modules from the git repositories. I still run into the same error. There is no dll openvr_api.dll in any folder in the openvr-hs git repository, so the copyLibWin.sh fails to copy anything in to /usr/local/bin. Having found that file in the C++ openvr folder from Valve, I tried that. However, you mentioned there was a specific version that was required, and I don't know where to get it. I'm still at the point where, on attempting to build the test cubes in MSYS2 64 bit, and having fixed the broken bool section in that header above, I get:
ghc.exe: C:\msys64\home\michaeljones\Documents\Programming\Haskell\OpenVR\openvr-hs\dist\build\HSopenvr-hs-0.1.0.0-LiBZHZGs2x88B234Gr5s3g.o: unknown symbol `_Z22VR_GetGenericInterfacePKcP12EVRInitError' Advice? If all this really is down to the specific version of the DLL I'm using, where do I get it, and what parts of the build do I have to clean and rebuild? (I can do a clean git pull after solving that I suppose). |
I tried building the test cases using cabal test. cabal test cubes didn't work either.
I managed to get as far as this output, after altering the cabal file for openvr-hs to point its extra include and extra library dirs at the spot where my OpenVR install was placed.
The resulting linker errors are below and relate to the functions VR_GetGenericInterface and VR_GetVRInitErrorAsEnglishDescription.
This may or may not be related to a separate problem: When I first tried to build the openvr-hs library, I ran into a complaint here in openvr_capi_fixed.h:
// #if defined( __WIN32 )
// typedef char bool;
// #else
#include <stdbool.h>
// #endif
Without the commenting-out, the compiler complains that bool is already defined, and it fails to even build, much less install, openvr-hs. But perhaps this is causing problems for the linker later on.
Advice?
$ cabal test
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Resolving dependencies...
Configuring openvr-hs-0.1.0.0...
Preprocessing library openvr-hs-0.1.0.0...
[1 of 1] Compiling Graphics.VR.OpenVR ( src\Graphics\VR\OpenVR.hs, dist\build\Graphics\VR\OpenVR.o )
[1 of 1] Compiling Graphics.VR.OpenVR ( src\Graphics\VR\OpenVR.hs, dist\build\Graphics\VR\OpenVR.p_o )
Preprocessing test suite 'minimal' for openvr-hs-0.1.0.0...
[1 of 1] Compiling Main ( app\Minimal.hs, dist\build\minimal\minimal-tmp\Main.p_o )
Linking dist\build\minimal\minimal.exe ...
C:\msys64\home\Michael Jones\Documents\Programming\Haskell\OpenVR\openvr-hs\dist\build/libHSopenvr-hs-0.1.0.0-K5yHTjbmNrL7i9N4GDus50_p.a(openvr_capi_helper.p_o):openvr_capi_helper.cpp:(.text+0x2c): undefined reference to
VR_GetGenericInterface(char const*, EVRInitError*)' C:\msys64\home\Michael Jones\Documents\Programming\Haskell\OpenVR\openvr-hs\dist\build/libHSopenvr-hs-0.1.0.0-K5yHTjbmNrL7i9N4GDus50_p.a(openvr_capi_helper.p_o):openvr_capi_helper.cpp:(.text+0x49): undefined reference to
VR_GetVRInitErrorAsEnglishDescription(EVRInitError)'collect2.exe: error: ld returned 1 exit status
gcc.exe' failed in phase
Linker'. (Exit code: 1)The text was updated successfully, but these errors were encountered: