【问题标题】:LNK2019 - visual studio 2013 - error despite having defined all symbolsLNK2019 - Visual Studio 2013 - 尽管定义了所有符号,但仍然出错
【发布时间】:2014-09-23 23:48:40
【问题描述】:

我在 Visual Studio 2013 中有一个 Win32 控制台应用程序项目。我已将该项目设置为使用 OpenCV 2.4.9。我也在使用 PGRFlyCapture SDK (http://ww2.ptgrey.com/sdk/flycap),所以我已经为这个 sdk 配置了 include、bin、lib 的路径。

我创建了一个头文件,以及一个用于定义头文件中声明的所有函数原型的 .cpp 文件。尽管如此,我还是收到了 LNK2019 unresolved external symbol 错误。

  1. 我需要帮助摆脱这些 LNK2019 错误。
  2. 想要一个指向 PGRFlyCapture SDK 的链接,因为我没有找到它,可能是我在 Visual Studio 中错误地使用项目配置了 SDK。

发布错误列表以供参考。

Error   21  error LNK1120: 20 unresolved externals  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\Debug\VideoGrabber_V3.exe VideoGrabber_V3
Error   1   error LNK2001: unresolved external symbol "const FlyCapture2::CameraBase::`vftable'" (??_7CameraBase@FlyCapture2@@6B@)  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\FlyCapture2GUId_v120.exp  VideoGrabber_V3
Error   13  error LNK2019: unresolved external symbol _AVIFileCreateStreamW@12 referenced in function "public: bool __thiscall PGRAviFile::open(char const *,int,int,int,double)" (?open@PGRAviFile@@QAE_NPBDHHHN@Z)    C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   9   error LNK2019: unresolved external symbol _AVIFileExit@0 referenced in function "public: bool __thiscall PGRAviFile::close(void)" (?close@PGRAviFile@@QAE_NXZ)  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   12  error LNK2019: unresolved external symbol _AVIFileGetStream@16 referenced in function "public: bool __thiscall PGRAviFile::open(char *)" (?open@PGRAviFile@@QAE_NPAD@Z) C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   8   error LNK2019: unresolved external symbol _AVIFileInit@0 referenced in function "public: bool __thiscall PGRAviFile::open(char *)" (?open@PGRAviFile@@QAE_NPAD@Z)   C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   11  error LNK2019: unresolved external symbol _AVIFileOpenW@16 referenced in function "public: bool __thiscall PGRAviFile::open(char *)" (?open@PGRAviFile@@QAE_NPAD@Z) C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   10  error LNK2019: unresolved external symbol _AVIFileRelease@4 referenced in function "public: bool __thiscall PGRAviFile::close(void)" (?close@PGRAviFile@@QAE_NXZ)   C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   20  error LNK2019: unresolved external symbol _AVIMakeCompressedStream@16 referenced in function "public: bool __thiscall PGRAviFile::open(char const *,int,int,int,double)" (?open@PGRAviFile@@QAE_NPBDHHHN@Z) C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   15  error LNK2019: unresolved external symbol _AVIStreamInfoW@12 referenced in function "public: bool __thiscall PGRAviFile::open(char *)" (?open@PGRAviFile@@QAE_NPAD@Z)   C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   18  error LNK2019: unresolved external symbol _AVIStreamRead@28 referenced in function "public: bool __thiscall PGRAviFile::readNextFrame(unsigned char *,bool)" (?readNextFrame@PGRAviFile@@QAE_NPAE_N@Z)  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   16  error LNK2019: unresolved external symbol _AVIStreamReadFormat@16 referenced in function "public: bool __thiscall PGRAviFile::open(char *)" (?open@PGRAviFile@@QAE_NPAD@Z)  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   14  error LNK2019: unresolved external symbol _AVIStreamRelease@4 referenced in function "public: bool __thiscall PGRAviFile::close(void)" (?close@PGRAviFile@@QAE_NXZ) C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   17  error LNK2019: unresolved external symbol _AVIStreamSetFormat@16 referenced in function "public: bool __thiscall PGRAviFile::open(char const *,int,int,int,double)" (?open@PGRAviFile@@QAE_NPBDHHHN@Z)  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   19  error LNK2019: unresolved external symbol _AVIStreamWrite@32 referenced in function "public: bool __thiscall PGRAviFile::appendBMP(char const *)" (?appendBMP@PGRAviFile@@QAE_NPBD@Z)   C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   6   error LNK2019: unresolved external symbol _ICClose@4 referenced in function "public: int __thiscall PGRAviFile::enumerateCompressors(int,int,int,struct ICINFO *,int)" (?enumerateCompressors@PGRAviFile@@QAEHHHHPAUICINFO@@H@Z)    C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   4   error LNK2019: unresolved external symbol _ICGetInfo@12 referenced in function "public: int __thiscall PGRAviFile::enumerateCompressors(int,int,int,struct ICINFO *,int)" (?enumerateCompressors@PGRAviFile@@QAEHHHHPAUICINFO@@H@Z) C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   3   error LNK2019: unresolved external symbol _ICInfo@12 referenced in function "public: int __thiscall PGRAviFile::enumerateCompressors(int,int,int,struct ICINFO *,int)" (?enumerateCompressors@PGRAviFile@@QAEHHHHPAUICINFO@@H@Z)    C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   5   error LNK2019: unresolved external symbol _ICOpen@12 referenced in function "public: int __thiscall PGRAviFile::enumerateCompressors(int,int,int,struct ICINFO *,int)" (?enumerateCompressors@PGRAviFile@@QAEHHHHPAUICINFO@@H@Z)    C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   7   error LNK2019: unresolved external symbol _ICSendMessage@16 referenced in function "public: int __thiscall PGRAviFile::enumerateCompressors(int,int,int,struct ICINFO *,int)" (?enumerateCompressors@PGRAviFile@@QAEHHHHPAUICINFO@@H@Z) C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3
Error   2   error LNK2019: unresolved external symbol _VideoForWindowsVersion@0 referenced in function "private: bool __thiscall PGRAviFile::checkVFWVersion(void)" (?checkVFWVersion@PGRAviFile@@AAE_NXZ)  C:\Users\jtower\Documents\Visual Studio 2013\Projects\VideoGrabber_V3\VideoGrabber_V3\PGRAviFile.obj    VideoGrabber_V3

【问题讨论】:

  • Vfw32.lib 的链接 - 这应该可以处理大部分问题。无法帮助FlyCapture2::CameraBase 一个。
  • 我可以在这方面获得更多帮助吗? Vfw32.lib 在哪里找到?
  • 它带有 Windows SDK,它应该是 Visual Studio 安装的一部分。只需在 Project > Properties > Linker > Input > Additional Dependencies 下提及它。
  • 谢谢!我做了一点挖掘,发现我的系统上没有安装 WindowsSDK。安装它并将 Vfw32.lib 链接到我的项目。除FlyCapture2::CameraBase 外的所有错误均已解决。
  • @IgorTandetnik,如果您将其作为答案发布,我会接受您的解决方案作为答案。

标签: visual-c++ visual-studio-2013 linker flycapture


【解决方案1】:

我做了一点挖掘,发现我的系统上没有安装 WindowsSDK。安装它并将 Vfw32.lib 链接到我的项目。所有 LNK2019 错误均已解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-06
    • 2014-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-11
    • 1970-01-01
    相关资源
    最近更新 更多