显然没有什么比翻转VS中的开关和使用DLL更困难了。无论我做了多少次,我似乎都无法做到这一点。
无论如何,我正试图将LibUSB与测试应用程序联系起来。我已经从LibUSB.info下载了Windows二进制文件,现在我想将它链接到我的测试项目。我的目录结构如下:
Folder PATH listing for volume Local Disk
Volume serial number is 00000200 1C56:6A00
C:.
| LibUSBTest.sdf
| LibUSBTest.sln
| out.txt
|
+---Debug
| LibUSBTest.pdb
|
+---ipch
| +---libusbtest-291f707a
| | libusbtest-85afab4d.ipch
| |
| \---libusbtest-e65e4917
| libusbtest-85afab4d.ipch
|
+---libusb
| | libusb-1.0.def
| | README.txt
| |
| +---examples
| | +---bin32
| | | fxload.exe
| | | listdevs.exe
| | | xusb.exe
| | |
| | +---bin64
| | | fxload.exe
| | | listdevs.exe
| | | xusb.exe
| | |
| | \---source
| | ezusb.c
| | ezusb.h
| | fxload.c
| | listdevs.c
| | stdint.h
| | xusb.c
| |
| +---include
| | \---libusb-1.0
| | libusb.h
| |
| +---MinGW32
| | +---dll
| | | libusb-1.0.dll
| | | libusb-1.0.dll.a
| | |
| | \---static
| | libusb-1.0.a
| |
| +---MinGW64
| | +---dll
| | | libusb-1.0.dll
| | | libusb-1.0.dll.a
| | |
| | \---static
| | libusb-1.0.a
| |
| +---MS32
| | +---dll
| | | libusb-1.0.dll
| | | libusb-1.0.lib
| | | libusb-1.0.pdb
| | |
| | \---static
| | libusb-1.0.lib
| |
| \---MS64
| +---dll
| | libusb-1.0.dll
| | libusb-1.0.lib
| | libusb-1.0.pdb
| |
| \---static
| libusb-1.0.lib
|
\---LibUSBTest
| LibUSBTest.cpp
| LibUSBTest.vcxproj
| LibUSBTest.vcxproj.filters
| ReadMe.txt
| stdafx.cpp
| stdafx.h
| targetver.h
|
\---Debug
| LibUSBTest.Build.CppClean.log
| LibUSBTest.log
| LibUSBTest.obj
| LibUSBTest.pch
| stdafx.obj
| vc120.idb
| vc120.pdb
|
\---LibUSBTest.tlog
cl.command.1.tlog
CL.read.1.tlog
CL.write.1.tlog
LibUSBTest.lastbuildstate
link-cvtres.read.1.tlog
link-cvtres.write.1.tlog
link-rc.read.1.tlog
link-rc.write.1.tlog
link.command.1.tlog
link.read.1.tlog
link.write.1.tlog
unsuccessfulbuild
| vc120.idb
| vc120.pdb
|
\---LibUSBTest.tlog
cl.command.1.tlog
CL.read.1.tlog
CL.write.1.tlog
LibUSBTest.lastbuildstate
link-cvtres.read.1.tlog
link-cvtres.write.1.tlog
link-rc.read.1.tlog
link-rc.write.1.tlog
link.command.1.tlog
link.read.1.tlog
link.write.1.tlog
unsuccessfulbuild
在我的源代码顶部,我已经定义#pragma comment(lib, "libusb-1.0.lib")
来添加库依赖项。
在属性 - > VC ++目录 - >图书馆目录下我添加了$(SolutionDir)libusb\MS32\dll\
,对于包含目录,我添加了{{1} }
为安全起见,在属性 - > C / C ++ - >一般 - >其他包含目录下添加了$(SolutionDir)libusb\include\libusb-1.0\
最后,在 Linker-> General->下;其他图书馆目录我添加了$(SolutionDir)libusb\include\libusb-1.0\
我假设我需要在项目目录中的某处复制DLL和/或Lib文件,但即使手动执行此操作也无济于事。
编辑:输出窗口结果
输出窗口导致我达到了字符数限制,所以我不得不求助于PasteBin使用该部分。