Important: Please read the Qt Code of Conduct -

Failing to load VRPN Library

  • Hello!

    I have been working on a project that integrates with the Virtual Reality Peripheral Network for a while now, and I recently learned how much easier it would be if I was using QT Creator to create my GUI instead of VS15 using C++/CLR. I went to start.. but when I try to load the VRPN.lib into the QT Creator project it tells me "LNK1104: cannot open file 'vrpn.lib'"

    I have linked it like so

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Lib/BuiltVRPN/release/ -lvrpn
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Lib/BuiltVRPN/debug/ -lvrpn
    else:unix: LIBS += -L$$PWD/../../Lib/BuiltVRPN/ -lvrpn
    INCLUDEPATH += $$PWD/../../Lib/vrpn
    DEPENDPATH += $$PWD/../../Lib/vrpn

    What am I doing wrong? I have the library working in my VS project so I am stumped as to why this isn't working..

    Any help would be greatly appreciated!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Does PWD contain an path with spaces ?

  • @SGaist no sir, it looks something like this:


    and the include/depend path is the same but BuiltVRPN is replaced with vrpn.

  • Lifetime Qt Champion

    What's the exact name of the vrpn.lib file ?



    Thank you for the quick replies! I am at a standstill with this project until I figure it out and I appreciate your help.

  • Lifetime Qt Champion

    What version of Visual Studio was used to build vrpn ?

  • Visual Studio 12 2013 Win64.

    And I am using the QT version (if this is useful at all):
    Qt Creator 3.6.0
    Based on Qt 5.5.1 (MSVC 2013, 32 bit)

  • Lifetime Qt Champion

    The Qt Creator version itself doesn't really matter. It can build Qt application with various compilers.

    However in your original post you mention VS15 so I guess you meant 2015 otherwise it would be 14 (the version number doesn't match the year). So if that's indeed the case, you have to rebuild vrpn with it. Microsoft compilers are not compatible one with the other so you must ensure that all the libraries and application you are building are using the same version of it.

  • Well, that was the case (compiled with VS 2013 and then recently updated to VS 2015), but I just recompiled in CMake using VS14 2015 and tried to include the library within my QT project with the same results..

    I was super excited thinking that that the solution.. damn.

  • Lifetime Qt Champion

    Then the silly question, are both the Release and Debug build of vrpn having the same name ? Not a trailing d or something like that ? I doubt it but some times there are surprises.

  • The Debug libraries do indeed have a d at the end of them.

    So since I remade the .lib file I can't get it to even open within my VS project so I am now thinking that the library is not compiling correctly... I tried to fix find a fix to this with no luck.. I am going to keep trying to fix it and then reimport it to QT and see if it works..

  • Lifetime Qt Champion

    If it has a suffix then you have to modify your LIBS line for debug i.e. LIBS += -lvrpnd

  • I was building VRPN for Release. Do you think that I should be building it for Debug...?

  • Lifetime Qt Champion

    Since you have the possibility build it for both so you can also debug if needed.

  • Building in Debug did fix loading the vrpn library (I also had to make sure I recursively cloned the git repository and its submodules) but now I am getting a linker error for an unresolved external symbol.

    I loaded up the library in an new project in Visual Studio and got the same error. When I moved the library into the directory of the project, the problem ceased and the library is working perfectly. I moved the library into the directory for the QT project, and I am still getting the external symbol error.

    I am wondering if this has to do with INCLUDEPATH and DEPENDPATH? I have both of them linking to the vrpn directory I cloned from git which has the header files and is what I ran through CMAKE to get my 'BuiltVRPN' folder and content. I then compiled the 'BuiltVRPN' project in VS14, and the library is in my BuiltVRPN\Debug folder. Is that correct? Is there something else that could be going on?

    Again, appreciate the help!

  • Lifetime Qt Champion

    Just to be sure, what version of Qt did you install ?

  • Qt Creator 3.6.0
    Based on Qt 5.5.1 (MSVC 2013, 32 bit)
    Built on Dec 15 2015 01:01:38
    From revision b52c2f91f5

    I see that MSVC 2013 was used. This is the problem, isn't it.

    I am downloading QT 5.6 which seems to have a MSVC2015 binary. I am hoping that this will solve the problem!

  • Lifetime Qt Champion

    That's the Qt Creator version. And the Qt version used to build it has absolutely no influence on that matter. What's important is the Qt version you installed as in "What package did you choose ?"


    that is the download I used to acquire QT5.6.0.

    The message I am getting is no longer failed to load vrpnd.lib, but now when I try to build while including the library I get a message saying "cannot open include file corecrt.h no such file or directory."

    It seems progress has been made at least a little bit.

  • Lifetime Qt Champion

    This blog article might be of interest. Basically, you'll have to add the missing include path to the universal CRT.