5

我来自 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 中包含库所需的步骤?

谢谢,

马克

4

2 回答 2

10

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

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

在此处输入图像描述

除非库文件位于 LIB 环境变量中,否则您将需要指定完全限定的路径 (d:\src\project\libs\camera.lib)。

于 2011-04-22T15:43:30.583 回答
2

在项目的属性页中,导航到 Configuration > Linker > Input 并将 lib 文件添加到 Additional Dependencies 设置。这适用于 VC++ 2008,可能同样适用于 2010。

于 2011-04-22T15:38:39.043 回答