C++ Visual Studio 2010中未解析的外部符号

C++ Visual Studio 2010中未解析的外部符号,c++,visual-studio-2010,openframeworks,C++,Visual Studio 2010,Openframeworks,我来自Xcode,试图在Visual Studio 2010中编译一个项目,但遇到以下错误: 2>ofxCLeye.obj : error LNK2019: unresolved external symbol "struct _GUID __cdecl CLEyeGetCameraUUID(int)" (?CLEyeGetCameraUUID@@YA?AU_GUID@@H@Z) referenced in function "public: static int __cdecl ofxC

我来自Xcode,试图在Visual Studio 2010中编译一个项目,但遇到以下错误:

2>ofxCLeye.obj : error LNK2019: unresolved external symbol "struct _GUID __cdecl CLEyeGetCameraUUID(int)" (?CLEyeGetCameraUUID@@YA?AU_GUID@@H@Z) referenced in function "public: static int __cdecl ofxCLeye::listDevices(void)" (?listDevices@ofxCLeye@@SAHXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "int __cdecl CLEyeGetCameraCount(void)" (?CLEyeGetCameraCount@@YAHXZ) referenced in function "public: static int __cdecl ofxCLeye::listDevices(void)" (?listDevices@ofxCLeye@@SAHXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeCameraGetFrameDimensions(void *,int &,int &)" (?CLEyeCameraGetFrameDimensions@@YA_NPAXAAH1@Z) referenced in function "public: void __thiscall ofxCLeye::grabFrame(void)" (?grabFrame@ofxCLeye@@QAEXXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeCameraGetFrame(void *,unsigned char *,int)" (?CLEyeCameraGetFrame@@YA_NPAXPAEH@Z) referenced in function "public: void __thiscall ofxCLeye::grabFrame(void)" (?grabFrame@ofxCLeye@@QAEXXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeDestroyCamera(void *)" (?CLEyeDestroyCamera@@YA_NPAX@Z) referenced in function "public: virtual void __thiscall ofxCLeye::close(void)" (?close@ofxCLeye@@UAEXXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeCameraStop(void *)" (?CLEyeCameraStop@@YA_NPAX@Z) referenced in function "public: virtual void __thiscall ofxCLeye::close(void)" (?close@ofxCLeye@@UAEXXZ)
... etc etc...
2>bin\clEye_debug.exe : fatal error LNK1120: 10 unresolved externals
我猜想编译器正在尝试链接CLEyeMulticam.lib,但没有找到它。我认为我已经正确地配置了它

您能告诉我在VS2010中包含库所需的步骤吗

谢谢,


marc

在项目的属性页中,导航到配置>链接器>输入,并将lib文件添加到附加依赖项设置中。这适用于VC++2008,可能也适用于2010。

如果这过于迂腐,请道歉。如果这是一个预构建的库(不是作为项目/解决方案的一部分构建的),那么请确保

a) #include the correct header
b) #define any requisite macros
c) speciy additional .lib dependencies as shown below. 


您需要指定一个完全限定的路径(d:\src\project\libs\camera.lib)除非库文件在LIB环境变量中。

CLEyeMulticam.LIB
您周围的文件,还是应该由VS2010生成?+1:但是如果您将libs目录添加到其他Include目录中,则不需要完全限定路径,请使用属性表添加路径,使用环境变量添加路径,或使用项目目录中的相对路径。这正是我所做的,但我仍然收到错误。一定是出了什么事。谢谢MARC MARC,库导出C还是C++接口?如果您试图用C++代码链接一个“C”库(我猜是API名称的情况),那么名字的“MrFLUP”会导致链接错误。在库头文件中,检查所有库函数是否包含在外部“C”{}块中。