QT Error with Twain Data Source
-
wrote on 20 Dec 2017, 20:53 last edited by
-
Hi ,
Thanks for your help. I m able to open and configure the project now. But getting below error when i build it. Can you please have a look and help.
@bhim
seem to be kinda old/invalid .pro file
can you show what is inside? -
wrote on 20 Dec 2017, 21:08 last edited by
Below is the content of pro file
unix {
TEMPLATE = subdirs
VERSION = 1.0
DEFINES += UNIX
}SUBDIRS = src
I have also shared entire project at below location for you.
https://drive.google.com/drive/folders/1gj69Kh7Xy8-p91uE3QUao673wqxoHidx?usp=sharing
-
Below is the content of pro file
unix {
TEMPLATE = subdirs
VERSION = 1.0
DEFINES += UNIX
}SUBDIRS = src
I have also shared entire project at below location for you.
https://drive.google.com/drive/folders/1gj69Kh7Xy8-p91uE3QUao673wqxoHidx?usp=sharing
-
wrote on 20 Dec 2017, 21:58 last edited by
Thanks It much better now. Though i am still getting lot of errors but these are datatype error and seems like code specific.
Thanks a lot for your help.
Bhim
-
Thanks It much better now. Though i am still getting lot of errors but these are datatype error and seems like code specific.
Thanks a lot for your help.
Bhim
@bhim
Np.
I noticed there are some FreeImage lib files.
Not sure it uses it but make sure they are compatible with vs 2008 if it does.Its pretty old project. there are no newer twain samples?
-
wrote on 20 Dec 2017, 22:10 last edited by bhim
-
This is the latest sample they have. With this i m getting below error , would you be able to help with this one as well?
I know how to take care of these in VS but not in QT.
@bhim
Well Qt is just a normal c++ LIB
and those are normal windows API calls so fix them like you normal would.
seems to be unicode related.
Didnt it later become common to put _TCHAR or something in front ?
or use wchar_t* and not char * ?
maybe you can just use the A version of the API and not W version -
Hi
I wondered if
https://github.com/twain/twain-samples
is something else than the twain you try ? -
wrote on 20 Dec 2017, 23:41 last edited by
I tried the exact same exact same Twain.
-
@bhim
Ok but it didnt work or was not what you wanted? -
wrote on 21 Dec 2017, 15:36 last edited by
-
wrote on 21 Dec 2017, 17:01 last edited by bhim
Hi,
I have resolved all string related error. Now my project is showing this :-1: error: LNK1104: cannot open file 'freeimage.lib' . If i could find the Visual Studio equivalent or Project property in QT, that would be very helpful to very file the linker paths.
-
Hi,
I have resolved all string related error. Now my project is showing this :-1: error: LNK1104: cannot open file 'freeimage.lib' . If i could find the Visual Studio equivalent or Project property in QT, that would be very helpful to very file the linker paths.
@bhim
you mean to link the LIB file to the project ?
http://doc.qt.io/qt-5/third-party-libraries.html
http://doc.qt.io/qtcreator/creator-project-qmake-libraries.htmlBasically you need a
LIBS += -L"3rdparty/CatWhisperer/lib" -lCatWhisperer
(with correct names of course) -
wrote on 21 Dec 2017, 19:37 last edited by
Thanks , this resolve the lib issue. Now below 2 error
14:31:45: Running steps for project src...
14:31:45: Configuration unchanged, skipping qmake step.
14:31:45: Starting: "C:\Qt\qtcreator-4.5.0\bin\jom.exe"
c:\Qt\4.8.7\bin\qmake.exe -spec c:\Qt\4.8.7\mkspecs\win32-msvc2008 CONFIG+=release -o Makefile ..\src\src.pro
C:\Qt\qtcreator-4.5.0\bin\jom.exe -f Makefile.Debug
link /LIBPATH:"c:\Qt\4.8.7\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /MANIFEST /MANIFESTFILE:"debug\TWAINDS_FreeImage.intermediate.manifest" /OUT:debug\TWAINDS_FreeImage.dll @C:\Users\rathorb\AppData\Local\Temp\TWAINDS_FreeImage.dll.13524.62.jom
TWAIN_UI.obj : error LNK2019: unresolved external symbol __imp__SHGetSpecialFolderPathA@16 referenced in function "public: __thiscall CTWAIN_UI::CTWAIN_UI(class CTWAINDS_FreeImage *)" (??0CTWAIN_UI@@QAE@PAVCTWAINDS_FreeImage@@@Z)
debug\TWAINDS_FreeImage.dll : fatal error LNK1120: 1 unresolved externals
jom: C:\ODIImages\Source\Twain\twain-samples-master\twain-samples-master\TWAIN-Samples\Twain_DS_sample01\build-src-Unnamed-Release\Makefile.Debug [debug\TWAINDS_FreeImage.dll] Error 1120
jom: C:\ODIImages\Source\Twain\twain-samples-master\twain-samples-master\TWAIN-Samples\Twain_DS_sample01\build-src-Unnamed-Release\Makefile [debug] Error 2
14:31:51: The process "C:\Qt\qtcreator-4.5.0\bin\jom.exe" exited with code 2.
Error while building/deploying project src (kit: Unnamed)
The kit Unnamed has configuration issues which might be the root cause for this problem.
When executing step "Make"
14:31:51: Elapsed time: 00:06.debug\TWAINDS_FreeImage.dll:-1: error: LNK1120: 1 unresolved externals
-
Hi
seems you need to link to
Shell32.lib also
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762204(v=vs.85).aspx -
wrote on 21 Dec 2017, 20:21 last edited by
Thanks. I m able to build and run it now. But not able to find the output file, a .ds file anywhere? Can you please help me find where project is generating this file.
Below is pro file code
unix {
TEMPLATE = lib
VERSION = 1.0
DEFINES += UNIX
}
PROJECT_FILE_NAME = TWAINDS_FreeImage
TARGET = $$PROJECT_FILE_NAME
LIBS += -lfreeimageTWAIN datasources end with a .ds instead of .so
QMAKE_POST_LINK = cp
$(TARGET)
$${PROJECT_FILE_NAME}.ds
ds.path = /usr/local/lib/twain/FreeImage
ds.files = $${PROJECT_FILE_NAME}.ds
TWAIN_logo.png
INSTALLS += ds
QMAKE_CLEAN = $${PROJECT_FILE_NAME}.ds
INCLUDEPATH = /usr/local/include
../../pub/external/include
../../pub/include
../../visual_studio/Debug32
../../common
LIBS += -L"../../pub/external/lib" -lFreeImage
SOURCES += ../../common/CTiffWriter.cpp
../../common/CommonTWAIN.cpp
CommonDS.cpp
CScanner_FreeImage.cpp
CTWAINDS_Base.cpp
CTWAINDS_FreeImage.cpp
DSMInterface.cpp
TWAINContainer.cpp
TWAINContainerFix32.cpp
TWAINContainerFrame.cpp
TWAINContainerInt.cpp
CTWAINDS_Sample1.cpp
TWAIN_UI.cpp
TWAINContainerString.cpp
TWAINContainerFix32Range.cpp
TWAINContainerBool.cpp
QT_UI.cpp
Qt_MainForm.cpp
Qt_About.cpp
Qt_ProfileName.cpp
HEADERS += ../../common/Common.h
../../common/CommonTWAIN.h
../../common/CTiffWriter.h
CScanner_FreeImage.h
CTWAINDS_Base.h
CTWAINDS_FreeImage.h
CommonDS.h
DSMInterface.h
TWAINContainerFix32.h
TWAINContainerFrame.h
TWAINContainer.h
TWAINContainerInt.h
CTWAINDS_Sample1.h
TWAIN_UI.h
TWAINContainerString.h
TWAINContainerFix32Range.h
TWAINContainerBool.h
QT_UI.h
Qt_MainForm.h
Qt_About.h
Qt_ProfileName.h
ui_About.h
ui_MainForm.h
ui_About.h
TEMPLATE = lib
CONFIG += warn_on
debug
x86 ppcQMAKE_BUNDLE_EXTENSION = ds
this project doesn't need any QT libs.
QMAKE_LIBS_QT =
QMAKE_LIBS_QT_THREAD =
FORMS += MainForm.ui
About.ui
ProfileName.ui
RESOURCES += qtresources.qrcunix|win32: LIBS += -lshell32
-
Thanks. I m able to build and run it now. But not able to find the output file, a .ds file anywhere? Can you please help me find where project is generating this file.
Below is pro file code
unix {
TEMPLATE = lib
VERSION = 1.0
DEFINES += UNIX
}
PROJECT_FILE_NAME = TWAINDS_FreeImage
TARGET = $$PROJECT_FILE_NAME
LIBS += -lfreeimageTWAIN datasources end with a .ds instead of .so
QMAKE_POST_LINK = cp
$(TARGET)
$${PROJECT_FILE_NAME}.ds
ds.path = /usr/local/lib/twain/FreeImage
ds.files = $${PROJECT_FILE_NAME}.ds
TWAIN_logo.png
INSTALLS += ds
QMAKE_CLEAN = $${PROJECT_FILE_NAME}.ds
INCLUDEPATH = /usr/local/include
../../pub/external/include
../../pub/include
../../visual_studio/Debug32
../../common
LIBS += -L"../../pub/external/lib" -lFreeImage
SOURCES += ../../common/CTiffWriter.cpp
../../common/CommonTWAIN.cpp
CommonDS.cpp
CScanner_FreeImage.cpp
CTWAINDS_Base.cpp
CTWAINDS_FreeImage.cpp
DSMInterface.cpp
TWAINContainer.cpp
TWAINContainerFix32.cpp
TWAINContainerFrame.cpp
TWAINContainerInt.cpp
CTWAINDS_Sample1.cpp
TWAIN_UI.cpp
TWAINContainerString.cpp
TWAINContainerFix32Range.cpp
TWAINContainerBool.cpp
QT_UI.cpp
Qt_MainForm.cpp
Qt_About.cpp
Qt_ProfileName.cpp
HEADERS += ../../common/Common.h
../../common/CommonTWAIN.h
../../common/CTiffWriter.h
CScanner_FreeImage.h
CTWAINDS_Base.h
CTWAINDS_FreeImage.h
CommonDS.h
DSMInterface.h
TWAINContainerFix32.h
TWAINContainerFrame.h
TWAINContainer.h
TWAINContainerInt.h
CTWAINDS_Sample1.h
TWAIN_UI.h
TWAINContainerString.h
TWAINContainerFix32Range.h
TWAINContainerBool.h
QT_UI.h
Qt_MainForm.h
Qt_About.h
Qt_ProfileName.h
ui_About.h
ui_MainForm.h
ui_About.h
TEMPLATE = lib
CONFIG += warn_on
debug
x86 ppcQMAKE_BUNDLE_EXTENSION = ds
this project doesn't need any QT libs.
QMAKE_LIBS_QT =
QMAKE_LIBS_QT_THREAD =
FORMS += MainForm.ui
About.ui
ProfileName.ui
RESOURCES += qtresources.qrcunix|win32: LIBS += -lshell32
@bhim
Its not in build folder? -
wrote on 21 Dec 2017, 20:27 last edited by
Its there, but its in dll extension, its supposed to be .ds extension.
-
@bhim
What is a .ds file ?
21/37