Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/147.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何让VS2008在C+中使用uuCDECL而不是uuThisCall+;项目_C++_Visual Studio 2008_Linker - Fatal编程技术网

C++ 如何让VS2008在C+中使用uuCDECL而不是uuThisCall+;项目

C++ 如何让VS2008在C+中使用uuCDECL而不是uuThisCall+;项目,c++,visual-studio-2008,linker,C++,Visual Studio 2008,Linker,我试图在VisualStudio 2008中构建一个开源C++项目。我加载了解决方案文件并编译了所有内容,但是由于找不到某些方法,我得到了一堆链接错误。在使用DUMPBIN.EXE检查所讨论的.lib文件后,我可以看到问题所在:在.lib中的方法的签名中都有\uuu cdecl,而链接器正在寻找与\uu thiscall等效的方法 如何让VS 2008改用\uu cdecl 注:该项目是一个基于OpenCV的多点触摸跟踪程序。该支架的用途是通过相机制造商提供的FlyCapture2库为名为Fle

我试图在VisualStudio 2008中构建一个开源C++项目。我加载了解决方案文件并编译了所有内容,但是由于找不到某些方法,我得到了一堆链接错误。在使用DUMPBIN.EXE检查所讨论的.lib文件后,我可以看到问题所在:在.lib中的方法的签名中都有
\uuu cdecl
,而链接器正在寻找与
\uu thiscall
等效的方法

如何让VS 2008改用
\uu cdecl

注:该项目是一个基于OpenCV的多点触摸跟踪程序。该支架的用途是通过相机制造商提供的FlyCapture2库为名为Fleal3的相机提供支持。以下是链接器错误:

1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Image::Image(void)" (__imp_??0Image@FlyCapture2@@QAE@XZ) referenced in function "public: __thiscall ofxFlea3::ofxFlea3(void)" (??0ofxFlea3@@QAE@XZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::Image::~Image(void)" (__imp_??1Image@FlyCapture2@@UAE@XZ) referenced in function "public: __thiscall ofxFlea3::ofxFlea3(void)" (??0ofxFlea3@@QAE@XZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Camera::Camera(void)" (__imp_??0Camera@FlyCapture2@@QAE@XZ) referenced in function "public: __thiscall ofxFlea3::ofxFlea3(void)" (??0ofxFlea3@@QAE@XZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::Camera::~Camera(void)" (__imp_??1Camera@FlyCapture2@@UAE@XZ) referenced in function "public: __thiscall ofxFlea3::ofxFlea3(void)" (??0ofxFlea3@@QAE@XZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::Error::~Error(void)" (__imp_??1Error@FlyCapture2@@UAE@XZ) referenced in function "void __cdecl PrintError(class FlyCapture2::Error)" (?PrintError@@YAXVError@FlyCapture2@@@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall FlyCapture2::Error::PrintErrorTrace(void)const " (__imp_?PrintErrorTrace@Error@FlyCapture2@@UBEXXZ) referenced in function "void __cdecl PrintError(class FlyCapture2::Error)" (?PrintError@@YAXVError@FlyCapture2@@@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::BusManager::GetCameraFromIndex(unsigned int,class FlyCapture2::PGRGuid *)" (__imp_?GetCameraFromIndex@BusManager@FlyCapture2@@UAE?AVError@2@IPAVPGRGuid@2@@Z) referenced in function "public: void __thiscall ofxFlea3::listDevices(void)" (?listDevices@ofxFlea3@@QAEXXZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::BusManager::~BusManager(void)" (__imp_??1BusManager@FlyCapture2@@UAE@XZ) referenced in function "public: void __thiscall ofxFlea3::listDevices(void)" (?listDevices@ofxFlea3@@QAEXXZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Error::Error(class FlyCapture2::Error const &)" (__imp_??0Error@FlyCapture2@@QAE@ABV01@@Z) referenced in function "public: void __thiscall ofxFlea3::listDevices(void)" (?listDevices@ofxFlea3@@QAEXXZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::BusManager::GetNumOfCameras(unsigned int *)" (__imp_?GetNumOfCameras@BusManager@FlyCapture2@@UAE?AVError@2@PAI@Z) referenced in function "public: void __thiscall ofxFlea3::listDevices(void)" (?listDevices@ofxFlea3@@QAEXXZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Error::Error(void)" (__imp_??0Error@FlyCapture2@@QAE@XZ) referenced in function "public: void __thiscall ofxFlea3::listDevices(void)" (?listDevices@ofxFlea3@@QAEXXZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::BusManager::BusManager(void)" (__imp_??0BusManager@FlyCapture2@@QAE@XZ) referenced in function "public: void __thiscall ofxFlea3::listDevices(void)" (?listDevices@ofxFlea3@@QAEXXZ)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Image::Save(char const *,enum FlyCapture2::ImageFileFormat)" (__imp_?Save@Image@FlyCapture2@@UAE?AVError@2@PBDW4ImageFileFormat@2@@Z) referenced in function "public: void __thiscall ofxFlea3::initFlea3(int,int,int,int)" (?initFlea3@ofxFlea3@@QAEXHHHH@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Image::Convert(enum FlyCapture2::PixelFormat,class FlyCapture2::Image *)const " (__imp_?Convert@Image@FlyCapture2@@UBE?AVError@2@W4PixelFormat@2@PAV12@@Z) referenced in function "public: void __thiscall ofxFlea3::initFlea3(int,int,int,int)" (?initFlea3@ofxFlea3@@QAEXHHHH@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Image::ReleaseBuffer(void)" (__imp_?ReleaseBuffer@Image@FlyCapture2@@UAE?AVError@2@XZ) referenced in function "protected: virtual void __thiscall ofxFlea3::getNewFrame(unsigned char *)" (?getNewFrame@ofxFlea3@@MAEXPAE@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual struct FlyCapture2::TimeStamp __thiscall FlyCapture2::Image::GetTimeStamp(void)const " (__imp_?GetTimeStamp@Image@FlyCapture2@@UBE?AUTimeStamp@2@XZ) referenced in function "protected: virtual void __thiscall ofxFlea3::getNewFrame(unsigned char *)" (?getNewFrame@ofxFlea3@@MAEXPAE@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual unsigned char * __thiscall FlyCapture2::Image::GetData(void)" (__imp_?GetData@Image@FlyCapture2@@UAEPAEXZ) referenced in function "protected: virtual void __thiscall ofxFlea3::getNewFrame(unsigned char *)" (?getNewFrame@ofxFlea3@@MAEXPAE@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual unsigned int __thiscall FlyCapture2::Image::GetDataSize(void)const " (__imp_?GetDataSize@Image@FlyCapture2@@UBEIXZ) referenced in function "protected: virtual void __thiscall ofxFlea3::getNewFrame(unsigned char *)" (?getNewFrame@ofxFlea3@@MAEXPAE@Z)
1>ofxFlea3.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall FlyCapture2::Image::GetDimensions(unsigned int *,unsigned int *,unsigned int *,enum FlyCapture2::PixelFormat *,enum FlyCapture2::BayerTileFormat *)const " (__imp_?GetDimensions@Image@FlyCapture2@@UBEXPAI00PAW4PixelFormat@2@PAW4BayerTileFormat@2@@Z) referenced in function "protected: virtual void __thiscall ofxFlea3::getNewFrame(unsigned char *)" (?getNewFrame@ofxFlea3@@MAEXPAE@Z)

默认情况下,VisualStudio将对成员函数使用此调用。由于编译正确,库中的头似乎没有显式声明调用约定

听起来您需要对库使用C链接。请尝试使用包装库标题

extern "C" { }

问题是我链接的是64位版本的外部FlyCapture2库。切换到32位版本解决了这个问题

你做了一些严重的错误,比如在C++类中包含了.Lo.h文件。不提供项目名称或不显示链接器错误对我们没有帮助。@HansPassant,10-4,我添加了项目链接和链接器错误。这样做会导致编译器出现如下错误:警告C4190:“ForceIPAddressToCamera”指定了C链接,但返回与C不兼容的UDT“FlyCapture2::Error”