Qt creator 2.8.1 and Qt4.8.5, Windows libtiff
-
Hi All,
i am a new in Qt. I have installed the qt creator 2.8.1 and qt 4.8.5 and now want to use external lib libtiff
after a long search i have configured the .pro file successfully liks:SOURCES += main.cpp
mainwindow.cpp
GUI.cpp
makeDNG.cppHEADERS += mainwindow.h
GUI.h
makeDNG.hFORMS += mainwindow.ui
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/"C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff"
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/"C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiffd"
else:unix: LIBS += "-L$$PWD/C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff"INCLUDEPATH += "C:/Program Files (x86)/tiff-3.9.4/libtiff"
DEPENDPATH += "C:/Program Files (x86)/tiff-3.9.4/libtiff"INCLUDEPATH += "C:/Program Files (x86)/tiff-3.9.4/libtiff"
DEPENDPATH += "C:/Program Files (x86)/tiff-3.9.4/libtiff"and now when i compile it occurs the errors always:
E:\janosch\QT\js_v21\makeDNG.cpp:156: Fehler:undefined reference to
TIFFOpen' E:\janosch\QT\js_v21\makeDNG.cpp:158: Fehler:undefined reference to
TIFFSetField'can someone explain how i can fix these problems...?
thx in advance and best regardssven
-
This is very suspicious:
bq.
win32:CONFIG: LIBS += -L$$PWD/“C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff”
else:win32:CONFIG: LIBS += -L$$PWD/“C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiffd”
else:unix: LIBS += “-L$$PWD/C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff”especially the unix part using a windows path.
You should rather have something like:
@
win32 {
LIBS += -L$$quote(“C:/Program Files (x86)/tiff-3.9.4/libtiff")
CONFIG(debug, debug|release): LIBS += -ltiffd
CONFIG(release, debug|release): LIBS += -ltiff
}
@For unix you can use pkgconfig to setup the linking to libtiff
Hope it helps
-
[quote author="SGaist" date="1379188967"]This is very suspicious:
bq.
win32:CONFIG: LIBS += -L$$PWD/“C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff”
else:win32:CONFIG: LIBS += -L$$PWD/“C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiffd”
else:unix: LIBS += “-L$$PWD/C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff”especially the unix part using a windows path.
You should rather have something like:
@
win32 {
LIBS += -L$$quote(“C:/Program Files (x86)/tiff-3.9.4/libtiff/)
CONFIG(debug, debug|release): LIBS += -ltiffd
CONFIG(release, debug|release): LIBS += -ltiff
}
@For unix you can use pkgconfig to setup the linking to libtiff
Hope it helps[/quote]
hallo, thanks for reply.
i use ur recommendation but still it doesnot work.
this error occuors : :-1: Fehler:cannot find -ltiffd
i replaced -ltiffd with -llibtiffd but it has the same errordo u have some material to learn how configure the .pro file especially how use external lib....
thanks a lot
-
Are you sure your path goes to the folder where tiff.lib and tiffd.lib are located ?
If you are using QtCreator, your can right-click on your project and use the Add Library function and you'll just have to follow the wizard.
-
[quote author="SGaist" date="1379272096"]Are you sure your path goes to the folder where tiff.lib and tiffd.lib are located ?
If you are using QtCreator, your can right-click on your project and use the Add Library function and you'll just have to follow the wizard.[/quote]
Hi, this is what i use add lib function :
win32: LIBS += -L$$PWD/C:/Program Files (x86)/tiff-3.9.4/libtiff/ -llibtiff
INCLUDEPATH += $$PWD/C:/Program Files (x86)/tiff-3.9.4/libtiff
DEPENDPATH += $$PWD/C:/Program Files (x86)/tiff-3.9.4/libtiffit is right..? i do not think ...
-
No it's not, $$PWD should not be there and the paths should be quoted.
Did you try the example I wrote ?
-
[quote author="SGaist" date="1379282182"]No it's not, $$PWD should not be there and the paths should be quoted.
Did you try the example I wrote ?[/quote]
I have tried you written code. if building the error :
:-1: Fehler:cannot find -ltiffd
:-1: Fehler:collect2: ld returned 1 exit status
then i repaced -ltiffd with -llibtiffd, the error stays still:
:-1: Fehler:cannot find -llibtiffd
:-1: Fehler:collect2: ld returned 1 exit statusi went back to have a look the location of the .lib file, under the path
C:/Program Files (x86)/tiff-3.9.4/libtiff
there are a libtiff.lib, libtiff_i.lib and libtiff.dllhow could i continue to configure....?
thanks
-
AFAICS you don't have libtiffd so link to libtiff
-
[quote author="SGaist" date="1379282182"]No it's not, $$PWD should not be there and the paths should be quoted.
Did you try the example I wrote ?[/quote]
right. i linkend in debug with -ltiff, it seems works but still an error:
C:\Program Files (x86)\tiff-3.9.4\libtiff\libtiff.dll:-1: Fehler:file not recognized: File format not recognized+
this error means a bad dll file or? -
When does this error happen ?
-
Can you show your complete pro file ?
-
[quote author="SGaist" date="1379451486"]Can you show your complete pro file ?[/quote]
hi, this is:
#-------------------------------------------------
Project created by QtCreator 2013-09-03T20:35:28
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = js_v21
TEMPLATE = appSOURCES += main.cpp
mainwindow.cpp
GUI.cpp
makeDNG.cppHEADERS += mainwindow.h
GUI.h
makeDNG.hFORMS += mainwindow.ui
win32 {
LIBS += -L$$quote(C:/Program Files (x86)/tiff-3.9.4/libtiff)
CONFIG(release, debug|release): LIBS += -ltiff
CONFIG(debug, debug|release): LIBS += -ltiff
} -
I just forgot one basic question... What architecture are you building for ?
-
[quote author="SGaist" date="1379489392"]I just forgot one basic question... What architecture are you building for ?[/quote]
Hi thanks for the help.
as stated when i built it said the libtiff.dll has a not recoginized format.
then i downloaded a libtiff,dll from internet and put it in the directory and now it works.
thanks.
but i still would like ask what does -ltiff mean? it means on linking, linkt to libtiff.dll? so what is the principle to write such thing?thanks again...
-
-ltiff means: link to the library file named tiff.lib.
On windows lib files are either static library (containing the actual library code) or stub files containing the information needed for the link phase, the dll being loaded at run time.
-
[quote author="SGaist" date="1379533471"]-ltiff means: link to the library file named tiff.lib.
On windows lib files are either static library (containing the actual library code) or stub files containing the information needed for the link phase, the dll being loaded at run time.[/quote]
but there is no a file called tiff.lib in the install path only a file called libtiff.lib.....
-
then use -llibtiff.
tiff vs libtiff is more a naming convention issue between VS libraries and gnu libraries