【发布时间】:2016-06-18 15:34:50
【问题描述】:
我正在尝试开始使用 VJoy 虚拟操纵杆,但无法启动和运行它。
我不断收到此错误:
main.cpp|14| undefined reference to `_imp__vJoyEnabled'
我正在尝试使用下面的代码运行它。
#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;
}
在代码块中,我已将编译器设置为使用 C++11 进行编译。 同样在代码块中,我已经链接了库(项目构建选项-> 链接器设置-> 添加库) 我也尝试过使用搜索目录,但似乎无法正常工作。
任何想法我错过了什么?
【问题讨论】:
标签: c++11 linker codeblocks