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. Linker issue
Forum Updated to NodeBB v4.3 + New Features

Linker issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 5 Posters 1.1k 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.
  • R Offline
    R Offline
    Romain.Besso
    wrote on last edited by
    #1

    Hi,

    I'm rather new to Qt and do not have a lot of experience with C++, but I currently encounter problemes with my .pro file.
    I'm currently trying to use Glib on Windows 10.
    You can se above the content of my .pro file and the related error.

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    TARGET = projetQtGraphic_aravis
    TEMPLATE = app
    
    SOURCES += main.cpp\
            MainWindow.cpp \
        Controleur.cpp \
        CameraGige_ByAravis.cpp
    
    HEADERS  += MainWindow.h \
        Controleur.h \
        CameraGige_ByAravis.h
    
    FORMS    += MainWindow.ui
    
    INCLUDEPATH += 'C:\msys64\mingw64\include\glib-2.0'
    INCLUDEPATH += 'C:\msys64\mingw64\lib\glib-2.0\include'
    INCLUDEPATH += 'C:\msys64\mingw64\include\glib-2.0\glib'
    INCLUDEPATH += 'C:\msys64\mingw64\include\aravis-0.8'
    
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibaravis-0.8
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibaravis-0.8
    else:unix: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibaravis-0.8.dll
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibgobject-2.0
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibgobject-2.0
    else:unix: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibgobject-2.0
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibglib-2.0
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibglib-2.0
    else:unix: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -llibglib-2.0
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    unix|win32: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -lffi
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    unix|win32: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -lintl
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    unix|win32: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -lpcre
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    unix|win32: LIBS += -L$$PWD/../../../../msys64/mingw64/lib/ -luuid
    
    INCLUDEPATH += $$PWD/../../../../msys64/mingw64/include
    DEPENDPATH += $$PWD/../../../../msys64/mingw64/include
    
    LIBS+=-luuid
    
    

    From what I understand it's a linker probleme for Glib, so I try differents things but I dont really understant what am I expecting to do. Anything to do with LIBS+= ?

    If you have any idea, it will be usefull.

    TY

    Romain

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      What is the error you are getting? Copy and paste the full error as well as the compile and link commands that were called before the error occurred.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Romain.Besso
        wrote on last edited by
        #3

        Hi, here is the error:

        15:21:26: Exécution des étapes pour le projet projetQtGraphic_aravis...
        15:21:26: Configuration inchangée, étape qmake sautée.
        15:21:26: Débute : "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -j2
        C:\Qt\6.2.3\mingw_64\bin\qmake.exe -o Makefile ..\projetQtGraphic_aravis\projetQtGraphic_aravis.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
        C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug
        mingw32-make[1]: Entering directory 'C:/Users/romainb/Documents/build-projetQtGraphic_aravis-Desktop_Qt_6_2_3_MinGW_64_bit-Debug'
        g++ -Wl,-subsystem,windows -mthreads -o debug\projetQtGraphic_aravis.exe debug/main.o debug/MainWindow.o debug/Controleur.o debug/CameraGige_ByAravis.o debug/moc_MainWindow.o debug/moc_Controleur.o debug/moc_CameraGige_ByAravis.o  -LC:\msys64\mingw64\lib C:\msys64\mingw64\lib\libaravis-0.8.dll.a C:\msys64\mingw64\lib\libgobject-2.0.a C:\msys64\mingw64\lib\libglib-2.0.a -lffi -lintl -lpcre -luuid C:\Qt\6.2.3\mingw_64\lib\libQt6Widgets.a C:\Qt\6.2.3\mingw_64\lib\libQt6Gui.a C:\Qt\6.2.3\mingw_64\lib\libQt6Core.a -lmingw32 C:\Qt\6.2.3\mingw_64\lib\libQt6EntryPoint.a -lshell32  
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(gutils.c.obj):(.text+0x59b): undefined reference to `__imp_CoTaskMemFree'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x2fa): undefined reference to `__imp_WSACloseEvent'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x3bc): undefined reference to `__imp_WSAEventSelect'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x3d9): undefined reference to `__imp_WSAGetLastError'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x432): undefined reference to `__imp_WSAGetLastError'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x1156): undefined reference to `__imp_ioctlsocket'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x11aa): undefined reference to `__imp_WSAGetLastError'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x121f): undefined reference to `__imp_send'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x12a2): undefined reference to `__imp_WSAGetLastError'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x13cf): undefined reference to `__imp_recv'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x1452): undefined reference to `__imp_WSAGetLastError'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x185a): undefined reference to `__imp_WSACreateEvent'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x1d6d): undefined reference to `__imp_WSAEnumNetworkEvents'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x1e21): undefined reference to `__imp_WSAEventSelect'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x21d4): undefined reference to `__imp_WSAEventSelect'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x221f): undefined reference to `__imp_WSASetEvent'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x23b2): undefined reference to `__imp_WSAGetLastError'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x2741): undefined reference to `__imp_closesocket'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x3ba0): undefined reference to `__imp_getsockopt'
        C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(giowin32.c.obj):(.text+0x3ce3): undefined reference to `__imp_WSACreateEvent'
        collect2.exe: error: ld returned 1 exit status
        mingw32-make[1]: Leaving directory 'C:/Users/romainb/Documents/build-projetQtGraphic_aravis-Desktop_Qt_6_2_3_MinGW_64_bit-Debug'
        mingw32-make[1]: *** [Makefile.Debug:84: debug/projetQtGraphic_aravis.exe] Error 1
        mingw32-make: *** [Makefile:45: debug] Error 2
        15:21:30: Le processus "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" s'est terminé avec le code 2.
        Erreur lors de la compilation/déploiement du projet projetQtGraphic_aravis (kit : Desktop Qt 6.2.3 MinGW 64-bit)
        When executing step "Make"
        15:21:30: Elapsed time: 00:04.
        

        ty

        1 Reply Last reply
        0
        • JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4
          This post is deleted!
          R Christian EhrlicherC 2 Replies Last reply
          0
          • JoeCFDJ JoeCFD

            This post is deleted!

            R Offline
            R Offline
            Romain.Besso
            wrote on last edited by
            #5

            @JoeCFD Actually, I don't have that lib. How do you recommend to install it on Win 10 ?
            I have MSYS2 if it can be useful.

            thanks in advance

            jsulmJ 1 Reply Last reply
            0
            • R Romain.Besso

              @JoeCFD Actually, I don't have that lib. How do you recommend to install it on Win 10 ?
              I have MSYS2 if it can be useful.

              thanks in advance

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Romain-Besso said in Linker issue:

              I have MSYS2 if it can be useful.

              No, it is not.
              Use MinGW installed with Qt to build that lib.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Romain-Besso said in Linker issue:

                I have MSYS2 if it can be useful.

                No, it is not.
                Use MinGW installed with Qt to build that lib.

                R Offline
                R Offline
                Romain.Besso
                wrote on last edited by
                #7

                @jsulm okay, I've never used it. I will look into doing this installation.

                Thanks

                JoeCFDJ 1 Reply Last reply
                0
                • R Romain.Besso

                  @jsulm okay, I've never used it. I will look into doing this installation.

                  Thanks

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #8

                  @Romain-Besso your app may not use it directly, but the libs your app use need it.

                  R 1 Reply Last reply
                  0
                  • JoeCFDJ JoeCFD

                    @Romain-Besso your app may not use it directly, but the libs your app use need it.

                    R Offline
                    R Offline
                    Romain.Besso
                    wrote on last edited by
                    #9

                    @JoeCFD @jsulm Building a lib with mingw seems unclear to me.
                    Can you tell me how to do it, if you know?
                    thanks in advance.

                    1 Reply Last reply
                    0
                    • JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • JoeCFDJ JoeCFD

                        This post is deleted!

                        Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @JoeCFD said in Linker issue:

                        __imp_WSACloseEvent

                        libzmq is missing
                        https://github.com/zeromq/libzmq/issues/2884

                        ??

                        WSACloseEvent is in Ws2_32.dll so the linker needs to link against Ws2_32 ...

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        R 1 Reply Last reply
                        5
                        • Christian EhrlicherC Christian Ehrlicher

                          @JoeCFD said in Linker issue:

                          __imp_WSACloseEvent

                          libzmq is missing
                          https://github.com/zeromq/libzmq/issues/2884

                          ??

                          WSACloseEvent is in Ws2_32.dll so the linker needs to link against Ws2_32 ...

                          R Offline
                          R Offline
                          Romain.Besso
                          wrote on last edited by
                          #12

                          @Christian-Ehrlicher You are right, with this include I have now only one err :

                          C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(gutils.c.obj):(.text+0x59b): undefined reference to `__imp_CoTaskMemFree'
                          

                          I think it's related to : https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree

                          But i dont have that Ole32 lib

                          Christian EhrlicherC 1 Reply Last reply
                          0
                          • R Romain.Besso

                            @Christian-Ehrlicher You are right, with this include I have now only one err :

                            C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libglib-2.0.a(gutils.c.obj):(.text+0x59b): undefined reference to `__imp_CoTaskMemFree'
                            

                            I think it's related to : https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cotaskmemfree

                            But i dont have that Ole32 lib

                            Christian EhrlicherC Offline
                            Christian EhrlicherC Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            @Romain-Besso said in Linker issue:

                            But i dont have that Ole32 lib

                            You have, it's a base windows dll similar to Ws2_32.dll

                            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                            Visit the Qt Academy at https://academy.qt.io/catalog

                            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