Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. A .lib problem when using QtCreator 2.3.1, Qt 4.7.4, and mingw32....
Forum Updated to NodeBB v4.3 + New Features

A .lib problem when using QtCreator 2.3.1, Qt 4.7.4, and mingw32....

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.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.
  • W Offline
    W Offline
    was22
    wrote on last edited by
    #1

    Hi,

    I am new to Qt but have developed before with C++. Appreciate your input since I have been trying to solve this issue for a while with no progress.

    I have a .lib library (deviceusb.lib) that was compiled using gcc and works fine from a command line windows program that was also built using gcc and statically linked to the that .lib.

    When trying to use the library from a GUI app in Qt, I get an ambiguous error saying:
    mingw32-make[1]: *** [debug\exer.exe] Error 1
    mingw32-make: *** [debug] Error 2
    The process "D:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
    Error while building project exer (target: Desktop)
    When executing build step 'Make'

    Best Regards,
    Was

    Here are the source code, .pro and output trace:


    @
    #include <QtGui/QApplication>
    #include "mainwindow.h"

    #include "libdeviceusb.h"

    int main(int argc, char *argv[])
    {
    device_Init(NULL, NULL, NULL);

    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    
    a.exec&#40;&#41;;
    
    device_Fini(&#41;;
    
    return 0;
    

    }@


    @
    QT += core gui

    TARGET = exer
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    win32: LIBS += -L$$PWD/../deviceusb/lib/ -ldeviceusb

    INCLUDEPATH += $$PWD/../deviceusb/src/include
    DEPENDPATH += $$PWD/../deviceusb/src/include

    win32: PRE_TARGETDEPS += $$PWD/../deviceusb/lib/deviceusb.lib


    Running build steps for project exer...
    Starting: "D:\QtSDK\mingw\bin\mingw32-make.exe" clean
    D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug clean
    mingw32-make[1]: Entering directory D:/systemt/exer-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug' del debug\moc_mainwindow.cpp del debug\main.o debug\mainwindow.o debug\moc_mainwindow.o mingw32-make[1]: Leaving directory D:/systemt/exer-build-desktop-Qt_4_7_4_for_Desktop_-MinGW_4_4__Qt_SDK__Debug'
    D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Release clean
    mingw32-make[1]: Entering directory D:/systemt/exer-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug' del release\moc_mainwindow.cpp del release\main.o release\mainwindow.o release\moc_mainwindow.o mingw32-make[1]: [compiler_moc_header_clean] Error 1 (ignored) mingw32-make[1]: Leaving directory D:/systemt/exer-build-desktop-Qt_4_7_4_for_Desktop
    -MinGW_4_4__Qt_SDK__Debug'
    mingw32-make[1]: [clean] Error 1 (ignored)
    The process "D:\QtSDK\mingw\bin\mingw32-make.exe" exited normally.
    Configuration unchanged, skipping qmake step.
    Starting: "D:\QtSDK\mingw\bin\mingw32-make.exe"
    D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory D:/systemt/exer-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"..\deviceusb\src\include" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\ActiveQt" -I"debug" -I"..\exer" -I"." -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++" -o debug\main.o ..\exer\main.cpp g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"..\deviceusb\src\include" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\ActiveQt" -I"debug" -I"..\exer" -I"." -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++" -o debug\mainwindow.o ..\exer\mainwindow.cpp D:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"..\deviceusb\src\include" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\ActiveQt" -I"debug" -I"..\exer" -I"." -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\exer\mainwindow.h -o debug\moc_mainwindow.cpp g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtGui" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"..\deviceusb\src\include" -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\include\ActiveQt" -I"debug" -I"..\exer" -I"." -I"..\..\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\win32-g++" -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp g++ -mthreads -Wl,-subsystem,windows -o debug\exer.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -L"d:\QtSDK\Desktop\Qt\4.7.4\mingw\lib" -lmingw32 -lqtmaind -LD:/systemt/exer/../deviceusb/lib/ -ldeviceusb -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib mingw32-make[1]: Leaving directory D:/systemt/exer-build-desktop-Qt_4_7_4_for_Desktop
    -_MinGW_4_4__Qt_SDK__Debug'
    mingw32-make[1]: *** [debug\exer.exe] Error 1
    mingw32-make: *** [debug] Error 2
    The process "D:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
    Error while building project exer (target: Desktop)
    When executing build step 'Make'
    @

    [edit] code tags added, koahnig

    1 Reply Last reply
    0
    • W Offline
      W Offline
      was22
      wrote on last edited by
      #2

      I'd appreciate if anyone can provide input on what I am doing wrong above.

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

        I see that you use OpenSSL in your project. I once hat problems using the prebuilt binaries of OpenSSL with MinGW and had to compile that manually. Can you try to build without OpenSSL?

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

        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