Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows includepath and libs

Windows includepath and libs

Scheduled Pinned Locked Moved General and Desktop
12 Posts 4 Posters 15.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    luca72
    wrote on last edited by
    #1

    hello i'm under windows if in the .pro file i add this
    @
    LIBS += -lClasse_scarico_rev_01
    INCLUDEPATH += C:\librerie_luca\Classe_scarico_rev_01
    @

    i get c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lClasse_scarico_rev_01

    if i write this
    @
    LIBS += C:\librerie_luca\Classe_scarico_rev_01
    LIBS += -lClasse_scarico_rev_01
    @
    i get c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: C:\librerie_luca\Classe_scarico_rev_01: No such file: Permission denied

    What is wrong

    Thanks Luca

    Edit: one thing that's wrong is your use of @ tags for the code ;-) ; Andre

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      The includepath is aimed at where header files are found. Not where library files are found. That is documented in the qmake Variable Reference documentation.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca72
        wrote on last edited by
        #3

        The .h file of the lib that i need to use are in

        C:\librerie_luca\Classe_scarico_rev_01

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          @
          LIBS += -LC:\librerie_luca\Classe_scarico_rev_01
          @

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            Better not to use backslashes though. They will trigger a qmake warning :-)

            1 Reply Last reply
            0
            • L Offline
              L Offline
              luca72
              wrote on last edited by
              #6

              @QT += core gui network webkit
              TARGET = Excalibur_rev_01
              TEMPLATE = app
              SOURCES += main.cpp\widget.cpp
              HEADERS += widget.h
              FORMS += widget.ui
              #LIBS += C:\librerie_luca\Classe_scarico_rev_01
              LIBS += -LC:\librerie_luca\Classe_scarico_rev_01
              INCLUDEPATH += C:\librerie_luca\Classe_scarico_rev_01@

              I get:
              @
              debug/widget.o:C:\Documents and Settings\Luca-XP\Desktop\progetti qt\Excalibur_rev_01\Excalibur_rev_01-build-desktop/../Excalibur_rev_01/widget.cpp:478: undefined reference to `_imp___ZN21Classe_scarico_rev_018connettoE12QHostAddress7QStringS1_iib'

              collect2: ld returned 1 exit status

              mingw32-make[1]: *** [debug\Excalibur_rev_01.exe] Error 1

              mingw32-make: *** [debug] Error 2

              The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
              Error while building project Excalibur_rev_01 (target: Desktop)
              When executing build step 'Make'
              @

              Edit: fixed use of @ tags: only one tag needed per code block; Andre

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                Did you try to re-run qmake and make clean and make to rebuild you project. Seems like the QNetwork lib is not in the link list.

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  luca72
                  wrote on last edited by
                  #8

                  yes but i get the same error

                  Luca

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    did you remove this line?

                    @LIBS += -lClasse_scarico_rev_01@

                    if yes, your lib is not linked to your program!

                    -L adds a library search path (like -I does for includes)
                    -l adds a particular library to your exe

                    (I misread the error message, actually there is not QtNetwork missing, but some of your own classes).

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      luca72
                      wrote on last edited by
                      #10

                      I never remove this but i get the same error:
                      From the program i have access to all the member of the class but i can't compile, this is the -pro file:

                      @QT += core gui network webkit

                      TARGET = Excalibur_rev_01
                      TEMPLATE = app

                      SOURCES += main.cpp
                      widget.cpp

                      HEADERS += widget.h

                      FORMS += widget.ui

                      LIBS += -LC:\librerie_luca\Classe_scarico_rev_01 -lClasse_scarico_rev_01

                      INCLUDEPATH += C:\librerie_luca\Classe_scarico_rev_01
                      @

                      and the error that i get is this:

                      @
                      Running build steps for project Excalibur_rev_01...
                      Starting: "c:/qt/2010.05/qt/bin/qmake.exe" C:/Documents and Settings/Luca-XP/Desktop/progetti_qt/Excalibur_rev_01/Excalibur_rev_01/Excalibur_rev_01.pro -r -spec win32-g++
                      WARNING: c:\Documents and Settings\Luca-XP\Desktop\progetti_qt\Excalibur_rev_01\Excalibur_rev_01\Excalibur_rev_01.pro:20: Unescaped backslashes are deprecated.

                      WARNING: c:\Documents and Settings\Luca-XP\Desktop\progetti_qt\Excalibur_rev_01\Excalibur_rev_01\Excalibur_rev_01.pro:20: Unescaped backslashes are deprecated.

                      WARNING: c:\Documents and Settings\Luca-XP\Desktop\progetti_qt\Excalibur_rev_01\Excalibur_rev_01\Excalibur_rev_01.pro:20: Unescaped backslashes are deprecated.

                      The process "c:/qt/2010.05/qt/bin/qmake.exe" exited normally.
                      @

                      than:

                      @
                      Running build steps for project Excalibur_rev_01...
                      Configuration unchanged, skipping qmake step.
                      Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
                      mingw32-make: Entering directory `C:/Documents and Settings/Luca-XP/Desktop/progetti_qt/Excalibur_rev_01/Excalibur_rev_01-build-desktop'

                      C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug

                      mingw32-make[1]: Entering directory `C:/Documents and Settings/Luca-XP/Desktop/progetti_qt/Excalibur_rev_01/Excalibur_rev_01-build-desktop'

                      c:\Qt\2010.05\qt\bin\uic.exe ..\Excalibur_rev_01\widget.ui -o ui_widget.h

                      g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtNetwork" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\Qt\2010.05\qt\include\QtWebKit" -I"c:\Qt\2010.05\qt\include" -I"c:\librerie_luca\Classe_scarico_rev_01" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Excalibur_rev_01" -I"." -I"c:\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\main.o ..\Excalibur_rev_01\main.cpp

                      g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtNetwork" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\Qt\2010.05\qt\include\QtWebKit" -I"c:\Qt\2010.05\qt\include" -I"c:\librerie_luca\Classe_scarico_rev_01" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Excalibur_rev_01" -I"." -I"c:\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\widget.o ..\Excalibur_rev_01\widget.cpp

                      ..\Excalibur_rev_01\widget.cpp: In member function 'void Widget::leggo_socket()':

                      ..\Excalibur_rev_01\widget.cpp:512: warning: unused variable 'vero'

                      C:\Qt\2010.05\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtNetwork" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\Qt\2010.05\qt\include\QtWebKit" -I"c:\Qt\2010.05\qt\include" -I"c:\librerie_luca\Classe_scarico_rev_01" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Excalibur_rev_01" -I"." -I"c:\Qt\2010.05\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\Excalibur_rev_01\widget.h -o debug\moc_widget.cpp

                      g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtNetwork" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\Qt\2010.05\qt\include\QtWebKit" -I"c:\Qt\2010.05\qt\include" -I"c:\librerie_luca\Classe_scarico_rev_01" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Excalibur_rev_01" -I"." -I"c:\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\moc_widget.o debug\moc_widget.cpp

                      g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\Excalibur_rev_01.exe debug/main.o debug/widget.o debug/moc_widget.o -L"c:\Qt\2010.05\qt\lib" -lmingw32 -lqtmaind -LC:\librerie_luca\Classe_scarico_rev_01 -lClasse_scarico_rev_01 -lQtWebKitd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4

                      mingw32-make[1]: Leaving directory `C:/Documents and Settings/Luca-XP/Desktop/progetti_qt/Excalibur_rev_01/Excalibur_rev_01-build-desktop'

                      mingw32-make: Leaving directory `C:/Documents and Settings/Luca-XP/Desktop/progetti_qt/Excalibur_rev_01/Excalibur_rev_01-build-desktop'

                      c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lClasse_scarico_rev_01

                      collect2: ld returned 1 exit status

                      mingw32-make[1]: *** [debug\Excalibur_rev_01.exe] Error 1

                      mingw32-make: *** [debug] Error 2

                      The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
                      Error while building project Excalibur_rev_01 (target: Desktop)
                      @

                      When executing build step 'Make'

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        giesbert
                        wrote on last edited by
                        #11

                        Just one idea, can you please post a dir listing of this folder:
                        C:\librerie_luca\Classe_scarico_rev_01

                        Nokia Certified Qt Specialist.
                        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          luca72
                          wrote on last edited by
                          #12

                          Hello
                          I have delete the lib an the program folder, remake all exact the same and now the program work.
                          Many thanks for you help and time

                          Luca

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved