0
votes

I am trying to get started with the VJoy virtual joystick, but i am having trouble getting it up and running.

I keep getting this error:

main.cpp|14| undefined reference to `_imp__vJoyEnabled'

I am trying to get it running using the code below.

#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include "public.h"
#include "vjoyinterface.h"

using namespace std;

int main()
{
    // Get the driver attributes (Vendor ID, Product ID, Version Number)
    if (!vJoyEnabled())
    {
        cout << "Function vJoyEnabled Failed - make sure that vJoy is installed and enabled\n" << endl;

    }

    cout << "Hello world!" << endl;
    return 0;
}

Within Codeblocks i have set the compiler to compile with C++11. Also within Codeblocks i have linked the library (Project build options -> linker settings -> add library) I have also tried playing with the Search Directory, but i can't seem to get it working.

Any ideas what i am missing?

1

1 Answers

0
votes

I found out i was linking to the wrong locations. Unfortunately there wasn't a clear error indicating this.

So the solution to this problem(in my case):
-Make sure you link to the right library locations
-Move the libraries and all of its associated files inside of the codeblocks project folder
-Add the library to the linked libraries(Project build options -> Linker settings -> Link libraries)
-Add the library locations to the search directories(Project build options -> Search directories -> Linker -> add)