Results 1 to 19 of 19

Thread: library in .pro file for qt

  1. #1
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default library in .pro file for qt

    Hi all,

    I'm relative newbee in QtDeveloppement with c++ on windows.

    I' m working on project with integration of videoInput library 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 :


    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4.  
    5. # Input
    6. HEADERS += webcamapp.h
    7. FORMS += winCam.ui
    8. SOURCES += main.cpp webcamapp.cpp
    9.  
    10. INCLUDEPATH += "C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp\include"
    11. LIBS += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
    12.  
    13. LIBS += -videoInputLib.a
    To copy to clipboard, switch view to plain text mode 

    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 :

    Qt Code:
    1. mingw32-make -f Makefile.Debug
    2. mingw32-make[1]: Entering directory `D:/production/worklab/cpp/progetTest/webcam
    3. QTV'
    4. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    5. oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
    6. g/webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind "-LC:\Program Files\video
    7. Input01995\compiledLib\compiledByDevCpp" -videoInputLib.a -lQtGuid4 -lQtCored4
    8. g++: unrecognized option `-videoInputLib.a'
    9. debug/webcamapp.o: In function `_ZN9WebCamAppC2Ev':
    10. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
    11. ence to `videoInput::listDevices(bool)'
    12. debug/webcamapp.o: In function `_ZN9WebCamAppC1Ev':
    13. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
    14. ence to `videoInput::listDevices(bool)'
    15. collect2: ld returned 1 exit status
    16. mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
    17. mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
    18. TV'
    19. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 

    Sorry for this poor indication, but i reallyy need to resolve this pb m .

    thank's a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: library in .pro file for qt

    Get rid of the dash before the name of the library. It should be:
    qmake Code:
    1. LIBS+=videoInputLib.a
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    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

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: library in .pro file for qt

    is it the same error coming again? if not, please post it

  5. #5
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    No, this time the library is don't find at all :


    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    2. oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
    3. g/webcamapp.o debug/moc_webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind "-L
    4. C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp" videoInputLib.a -
    5. lQtGuid4 -lQtCored4
    6. g++: videoInputLib.a: No such file or directory
    7. mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
    8. mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
    9. TV'
    10. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: library in .pro file for qt

    Qt Code:
    1. LIBS += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
    2.  
    3. LIBS += -videoInputLib.a
    To copy to clipboard, switch view to plain text mode 

    first statement should not be LIBS += , but DEPENDPATH += , cuz u r providing an extra path to be searched..check if it works with this

  7. #7
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: library in .pro file for qt

    Quote Originally Posted by talk2amulya View Post
    Qt Code:
    1. LIBS += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
    2.  
    3. LIBS += -videoInputLib.a
    To copy to clipboard, switch view to plain text mode 

    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
    Let your work talk for you

  8. #8
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    ....i' modified the .pro this way :

    Qt Code:
    1. INCLUDEPATH += "C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp\include"
    2.  
    3. DEPENDPATH += -L"C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp"
    4.  
    5. LIBS +=-videoInputLib.a
    To copy to clipboard, switch view to plain text mode 

    but it give me allway an error :

    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    2. oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
    3. g/webcamapp.o debug/moc_webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind -vi
    4. deoInputLib.a -lQtGuid4 -lQtCored4
    5. g++: unrecognized option `-videoInputLib.a'
    6. debug/webcamapp.o: In function `_ZN9WebCamAppC2Ev':
    7. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
    8. ence to `videoInput::listDevices(bool)'
    9. debug/webcamapp.o: In function `_ZN9WebCamAppC1Ev':
    10. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
    11. ence to `videoInput::listDevices(bool)'
    12. collect2: ld returned 1 exit status
    13. mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
    14. mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
    15. TV'
    16. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 

  9. #9
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: library in .pro file for qt

    did you try
    LIBS += -lvideoInputLib.a
    ??
    Let your work talk for you

  10. #10
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    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)

    ...

  11. #11
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: library in .pro file for qt

    Quote Originally Posted by fbmfbm View Post
    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
    Let your work talk for you

  12. #12
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: library in .pro file for qt

    Qt Code:
    1. win32:LIBS += C:/Program Files/videoInput01995/compiledLib/compiledByDevCpp/videoInputLib.a
    To copy to clipboard, switch view to plain text mode 

    this should work!

  13. #13
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    ...hum, with this it seam that the path is ok...but it's like the library is not active...no ??


    Qt Code:
    1. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    2. oc -mthreads -Wl -Wl,-subsystem,windows -o debug\webcamQTV.exe debug/main.o debu
    3. g/webcamapp.o debug/moc_webcamapp.o -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind "-L
    4. C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp-lvideoInputLib.a"
    5. -lQtGuid4 -lQtCored4
    6. debug/webcamapp.o: In function `_ZN9WebCamAppC2Ev':
    7. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:14: undefined refer
    8. ence to `videoInput::videoInput()'
    9. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
    10. ence to `videoInput::listDevices(bool)'
    11. debug/webcamapp.o: In function `_ZN9WebCamAppC1Ev':
    12. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:14: undefined refer
    13. ence to `videoInput::videoInput()'
    14. D:/production/worklab/cpp/progetTest/webcamQTV/webcamapp.cpp:15: undefined refer
    15. ence to `videoInput::listDevices(bool)'
    16. collect2: ld returned 1 exit status
    17. mingw32-make[1]: *** [debug\webcamQTV.exe] Error 1
    18. mingw32-make[1]: Leaving directory `D:/production/worklab/cpp/progetTest/webcamQ
    19. TV'
    20. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 

  14. #14
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: library in .pro file for qt

    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

  15. #15
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    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 ):

    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3.  
    4.  
    5. # Input
    6. HEADERS += webcamapp.h
    7. FORMS += winCam.ui
    8. SOURCES += main.cpp webcamapp.cpp
    9.  
    10. INCLUDEPATH += "C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp\include"\
    11. "C:\Program Files\videoInput01995\libs\DShow\include"
    12.  
    13. LIBS +="C:\Program Files\videoInput01995\compiledLib\compiledByDevCpp\videoInputLib.a"
    14.  
    15. LIBS +=-L"C:\Program Files\videoInput01995\libs\DShow\lib"\
    16. -lddraw\
    17. -ldxguid\
    18. -lole32\
    19. -loleaut32\
    20. -lstrmbasd\
    21. -lstrmbase\
    22. -lstrmiids\
    23. -luuid
    To copy to clipboard, switch view to plain text mode 


    and all is now compiling ok !!

    thank's for your help and patience !

  16. #16
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: library in .pro file for qt

    well, if u like what i did, u can consider clicking on that little shining, lirking in the dark, "thanks" button

  17. The following user says thank you to talk2amulya for this useful post:

    fbmfbm (19th February 2009)

  18. #17
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: library in .pro file for qt

    i do it and say "thank's a lot" to )

    fbm

  19. #18
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: library in .pro file for qt

    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?

  20. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: library in .pro file for qt

    It seems you are mixing MinGW and MSVC libraries.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 4
    Last Post: 18th December 2009, 18:55
  2. Replies: 2
    Last Post: 8th November 2007, 20:15
  3. need script to change qmake .pro file
    By rajeshs in forum Qt Programming
    Replies: 5
    Last Post: 7th July 2007, 17:53
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. Can I use the Sql Module without chanage .pro file?
    By fengtian.we in forum Qt Programming
    Replies: 9
    Last Post: 21st May 2007, 10:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.