View Full Version : library in .pro file for qt
fbmfbm
18th February 2009, 22:21
Hi all,
I'm relative newbee in QtDeveloppement with c++ on windows.
I' m working on project with integration of videoInput library (http://muonics.net/school/spring05/videoInput/) and Qt4 gui together, but i have some pbm to include this lib in the .pro file for compiling :
I'm using mingw32 and Qt4.43.
this is mi simple .pro file :
TEMPLATE = app
TARGET =
DEPENDPATH += .
# Input
HEADERS += webcamapp.h
FORMS += winCam.ui
SOURCES += main.cpp webcamapp.cpp
INCLUDEPATH += "C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp \include"
LIBS += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
LIBS += -videoInputLib.a
i'm testing with -lvideoInputLib to but the lib is not find...!!!
the library is in an directory : videoInputLib.a with an other dir for include .h
If i use this library in codeblocks with the same mingw without Qt4 project there is no pbm....
is there a special command in .pro file to include lib in .a format and not .lib ?
(i can import some other lib if it's in this format from other library).
the make process return this error :
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/production/worklab/cpp/progetTest/webcam
QTV'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
g/webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind "-LC:\Program Files\video
Input01995\compiledLib\compiledByDevCpp" -videoInputLib.a -lQtGuid4 -lQtCored4
g++: unrecognized option `-videoInputLib.a'
debug/webcamapp.o: In function `_ZN9WebCamAppC2Ev':
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
ence to `videoInput::listDevices(bool)'
debug/webcamapp.o: In function `_ZN9WebCamAppC1Ev':
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
ence to `videoInput::listDevices(bool)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
TV'
mingw32-make: *** [debug] Error 2
Sorry for this poor indication, but i reallyy need to resolve this pb m .
thank's a lot.
wysota
19th February 2009, 01:07
Get rid of the dash before the name of the library. It should be:
LIBS+=videoInputLib.a
fbmfbm
19th February 2009, 10:56
hi wysoata,
thank's for your reply....but this don't work....the library is don't find by gcc++.
and i have chekking one more time that the path is the good one.....
i don'k know where to find a way to fixe that
talk2amulya
19th February 2009, 11:05
is it the same error coming again? if not, please post it
fbmfbm
19th February 2009, 11:10
No, this time the library is don't find at all :
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
g/webcamapp.o debug/moc_webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind "-L
C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp" videoInputLib.a -
lQtGuid4 -lQtCored4
g++: videoInputLib.a: No such file or directory
mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
TV'
mingw32-make: *** [debug] Error 2
talk2amulya
19th February 2009, 11:17
LIBS += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
LIBS += -videoInputLib.a
first statement should not be LIBS += , but DEPENDPATH += , cuz u r providing an extra path to be searched..check if it works with this
jogeshwarakundi
19th February 2009, 11:32
LIBS += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
LIBS += -videoInputLib.a
first statement should not be LIBS += , but DEPENDPATH += , cuz u r providing an extra path to be searched..check if it works with this
also while giving library name:
LIBS += -lvideoInputLib.a
should be used
fbmfbm
19th February 2009, 11:32
....i' modified the .pro this way :
INCLUDEPATH += "C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp \include"
DEPENDPATH += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
LIBS +=-videoInputLib.a
but it give me allway an error :
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
g/webcamapp.o debug/moc_webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind -vi
deoInputLib.a -lQtGuid4 -lQtCored4
g++: unrecognized option `-videoInputLib.a'
debug/webcamapp.o: In function `_ZN9WebCamAppC2Ev':
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
ence to `videoInput::listDevices(bool)'
debug/webcamapp.o: In function `_ZN9WebCamAppC1Ev':
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
ence to `videoInput::listDevices(bool)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
TV'
mingw32-make: *** [debug] Error 2
jogeshwarakundi
19th February 2009, 11:40
did you try
LIBS += -lvideoInputLib.a
??
fbmfbm
19th February 2009, 11:48
yes, i try this differents options :
LIBS +=-videoInputLib.a (=unrocognized option)
LIBS +=-lvideoInputLib.a (=can not find )
LIBS +=videoInputLib.a (=unrocognized option)
LIBS +=-videoInputLib (=unrocognized option)
LIBS +=--lvideoInputLib (=unrocognized option)
...
jogeshwarakundi
19th February 2009, 11:50
yes, i try this differents options :
LIBS +=-videoInputLib.a (=unrocognized option)
LIBS +=-lvideoInputLib.a (=can not find )
LIBS +=videoInputLib.a (=unrocognized option)
LIBS +=-videoInputLib (=unrocognized option)
LIBS +=--lvideoInputLib (=unrocognized option)
...
it says cannot find for -lvideoInputLib.a because the path could be wrong somewhere?
try:
LIBS += -L/path/to/lib -lvideoInputLib.a
talk2amulya
19th February 2009, 11:57
win32:LIBS += C:/Program Files/videoInput01995/compiledLib/compiledByDevCpp/videoInputLib.a
this should work!
fbmfbm
19th February 2009, 12:01
...hum, with this it seam that the path is ok...but it's like the library is not active...no ??
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
g/webcamapp.o debug/moc_webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind "-L
C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp-lvideoInputLib.a"
-lQtGuid4 -lQtCored4
debug/webcamapp.o: In function `_ZN9WebCamAppC2Ev':
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:14: undefined refer
ence to `videoInput::videoInput()'
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
ence to `videoInput::listDevices(bool)'
debug/webcamapp.o: In function `_ZN9WebCamAppC1Ev':
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:14: undefined refer
ence to `videoInput::videoInput()'
D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
ence to `videoInput::listDevices(bool)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
TV'
mingw32-make: *** [debug] Error 2
talk2amulya
19th February 2009, 12:31
did u try what i mentioned.. if that doesnt work, then maybe there is some issue with the .a library inclusion..although that seems frivilous..cuz mingw should recognize that
fbmfbm
19th February 2009, 12:42
Your'r right.....i don't see your last post.
that's the way. I modified my .pro like that ( and include some reference to directshow libs i need ):
TEMPLATE = app
TARGET =
# Input
HEADERS += webcamapp.h
FORMS += winCam.ui
SOURCES += main.cpp webcamapp.cpp
INCLUDEPATH += "C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp \include"\
"C:\Program Files\videoInput01995\libs\DShow\include"
LIBS +="C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp \videoInputLib.a"
LIBS +=-L"C:\Program Files\videoInput01995\libs\DShow\lib"\
-lddraw\
-ldxguid\
-lole32\
-loleaut32\
-lstrmbasd\
-lstrmbase\
-lstrmiids\
-luuid
and all is now compiling ok !!
thank's for your help and patience !
talk2amulya
19th February 2009, 12:45
well, if u like what i did, u can consider clicking on that little shining, lirking in the dark, "thanks" button :)
fbmfbm
19th February 2009, 12:52
i do it and say "thank's a lot" to ;))
fbm
hatred
4th July 2010, 16:13
i tried also the program above to compile my project which also use videoinput, ths is my .pro file
INCLUDEPATH += "C:\Program Files\videoInput0.1995\videoInput0.1995\compiledLi b\compiledByDevCpp \include"
INCLUDEPATH += "C:\Program Files\videoInput0.1995\videoInput0.1995\libs\DShow \include"
LIBS += "C:\OpenCV\lib\videoInput.lib"
LIBS += "C:\Program Files\videoInput0.1995\videoInput0.1995\compiledLi b\compiledByDevCpp\videoInputLib.a"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\ddraw.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\dxguid.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\ole32.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\oleaut32.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\strmbasd.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\strmbase.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\strmiids.lib"
LIBS +="C:\Program Files\videoInput0.1995\videoInput0.1995\videoInput SrcAndDemos\libs\DShow\lib\uuid.lib"
but after i compile it this error come out:
error: collect2: ld returned 1 exit status
could someone help me?
wysota
9th July 2010, 08:37
It seems you are mixing MinGW and MSVC libraries.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.