Skip to content

Linker error during attempt to build the cabal tests #3

@codeweaverx

Description

@codeweaverx

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions