简体   繁体   English

链接.lib文件时遇到问题

[英]Trouble linking .lib files

I am currently trying to link three lib files into a C++ project that will read incoming information from a USB port. 我目前正在尝试将三个lib文件链接到一个C ++项目中,该项目将从USB端口读取传入的信息。 but after following the steps to add the dmgr.lib and dstm.lib files I am receiving the following errors: 但是在执行添加dmgr.lib和dstm.lib文件的步骤之后,我收到以下错误:

Error   6   error LNK1120: 5 unresolved externals   c:\users\austi_000\documents\visual studio 2012\Projects\USBTest\Debug\USBTest.exe
Error   2   error LNK2019: unresolved external symbol __imp__DmgrClose referenced in function "void __cdecl ErrorExit(void)" (?ErrorExit@@YAXXZ)    c:\Users\austi_000\documents\visual studio 2012\Projects\USBTest\USBTest\DstmDemo.obj
Error   1   error LNK2019: unresolved external symbol __imp__DmgrOpen referenced in function _main  c:\Users\austi_000\documents\visual studio 2012\Projects\USBTest\USBTest\DstmDemo.obj
Error   4   error LNK2019: unresolved external symbol __imp__DstmDisable referenced in function "void __cdecl ErrorExit(void)" (?ErrorExit@@YAXXZ)  c:\Users\austi_000\documents\visual studio 2012\Projects\USBTest\USBTest\DstmDemo.obj
Error   3   error LNK2019: unresolved external symbol __imp__DstmEnable referenced in function _main    c:\Users\austi_000\documents\visual studio 2012\Projects\USBTest\USBTest\DstmDemo.obj
Error   5   error LNK2019: unresolved external symbol __imp__DstmIO referenced in function _main    c:\Users\austi_000\documents\visual studio 2012\Projects\USBTest\USBTest\DstmDemo.obj

To add the files I did Project -> Properties -> Configuration Properties -> Linker -> General Then I added $(DSTM)\\lib\\x64_win64_vc11_md;$(DMGR)\\lib\\x64_win64_vc11_md;$(DPCDECL)\\lib\\x64_win64_vc11_md to the Additional Library Directories . 要添加文件,请执行Project -> Properties -> Configuration Properties -> Linker -> General然后添加$(DSTM)\\lib\\x64_win64_vc11_md;$(DMGR)\\lib\\x64_win64_vc11_md;$(DPCDECL)\\lib\\x64_win64_vc11_md ; Additional Library Directories

Next I added dstm.lib;dmgr.lib; 接下来,我添加了dstm.lib;dmgr.lib; to Linker -> Input . Linker -> Input

Next I added C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\include;%(AdditionalIncludeDirectories) to C/C++ -> Additional Include Directories . 接下来,我添加了C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\include;%(AdditionalIncludeDirectories)C/C++ -> Additional Include Directories

Finally I added C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;$(IncludePath) in VC++ Directories -> Include Directories and C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;$(LibraryPath) in VC++ Directories -> Library Directories . 最后我在VC++ Directories -> Include Directories添加了C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;$(IncludePath) VC++ Directories -> Include DirectoriesC:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;$(LibraryPath) VC++ Directories -> Library Directories C:\\Users\\austi_000\\Downloads\\digilent.adept.sdk_v2.3.1\\digilent.adept.sdk_v2.3.1\\lib64;$(LibraryPath)

Any clue what's wrong? 任何线索出什么事了吗?

http://msdn.microsoft.com/en-us/library/wdsk6as6.aspx http://msdn.microsoft.com/zh-CN/library/wdsk6as6.aspx

To set this linker option in the Visual Studio development environment Open the project's Property Pages dialog box. 在Visual Studio开发环境中设置此链接器选项的步骤打开项目的“属性页”对话框。 For details, see Setting Visual C++ Project Properties. 有关详细信息,请参见设置Visual C ++项目属性。 Expand the Linker folder. 展开链接器文件夹。 Select the Command Line property page. 选择“命令行”属性页。 Add the option to the Additional Options box. 将选项添加到“其他选项”框中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM