在这里,我描述了尝试构建以下C++项目的步骤:
http://sourceforge.net/projects/twain-samples/files/TWAIN%202%20Sample%20Application/
在Microsoft 7- 64位上。我的最终目标是保留这个功能,并添加命令行参数,这样我就可以在批处理文件中运行它,因为现在,它是一个基于菜单的软件。
- Version 3.5.0 (based on Qt 5.5.0 (MSVC 2013, 32 bit)
- Kits available:
- Desktop Qt 5.4.2 MSVC2013 64bit2
- Desktop Qt 5.5.0 MSVC2010 32bit
- Desktop Qt 5.5.0 MSVC2012 32bit
- Desktop Qt 5.5.0 MSVC2013 32bit
- Desktop Qt 5.5.0 MSVC2013 64bit
- [http://downloads.sourceforge.net/freeimage/FreeImage3170Win32Win64.zip](http://downloads.sourceforge.net/freeimage/FreeImage3170Win32Win64.zip)
- Uncompress **FreeImage3170Win32Win64.zip**
- open the folder **FreeImage\Dist\x64**
- Copy **freeimage.dll** in the **C:\Windows\System32** folder
- Download **Twain\_App\_sample.source.zip** in [http://sourceforge.net/projects/twain-samples/files/TWAIN%202%20Sample%20Application/](http://sourceforge.net/projects/twain-samples/files/TWAIN%202%20Sample%20Application/)
- Uncompress the archive **Twain\_App\_sample.source.zip**, that gives the 2 following folders:
- **Twain\_App\_sample01**
- **common**
- copy **Freeimage.h** in the **common** folder
- create a **lib** folder in **Twain\_App\_sample01\src** folder
- copy **freeimage.lib** in **Twain\_App\_sample01\src\lib** folder
- launch **Qt Creator**
- in Qt, click **Open project**
- choose the file **src.pro** in the **Twain\_App\_sample01\src** folder
- in _**Configure Project**_ choose the Kit **Desktop Qt 5.5.0 MSVC2013 64bit**
- click the **Configure project** button
- in **DSMInterface.cpp** source file, add this function:
wchar_t* wchar_t* wString=new wchar_t4096;MultiByteToWideChar(CP_ACP,0,charArray,-1,wString,4096);
-在DSMInterface.cpp,函数LoadDSMLib中,替换
if((gpDSM=LOADLIBRARY(_pszLibName)) != 0)
使用
if((gpDSM=LOADLIBRARY(convertCharArrayToLPCWSTR(_pszLibName))) != 0)
- Now i get a message from the linker:
DSMInterface.obj:-1: error : LNK2019: unresolved external symbol "int __cdecl VerifyEmbeddedSignature(wchar_t const *)" (?VerifyEmbeddedSignature@@YAHPEB_W@Z) referenced in function "bool __cdecl LoadDSMLib(char *)" (?LoadDSMLib@@YA_NPEAD@Z)
我将Twain_App_sample01\src\VerifySignature.cpp文件添加到项目中,现在这条消息消失了(这要感谢Itay Grudev )
..\src\VerifySignature.cpp(13) : fatal error C1083: Cannot open include file: 'afx.h': No such file or directory
发布于 2015-10-14 12:26:01
事实上,我是从错误的工具开始的。感谢,Ben,,他把我送上了正确的轨道。我需要MFC。所以正确的解决方案是使用Visual 2015。我可以用它来建造它。
https://stackoverflow.com/questions/33037287
复制相似问题