Results 1 to 8 of 8

Thread: DLL linking problem after putting winavr on path

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Apr 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: DLL linking problem after putting winavr on path

    Hi,

    I had a similar problem when making qwt dll. So i made some debug and found the the ld parameters where with backslashes (-L parameter). I found that the winavr sh.exe shell was used by the toolchain and the link cmd line was (notice backslashes in :-LC:\Qt\Q...)
    echo linking ../lib/qwtd.dll && g++ -shared -mthreads -Wl,--out-implib,C:/MinGW-Lib/qwt-6.1-rc3/src/../lib/libqwtd.a -o ../lib/qwtd.dll object_script.qwtd.Debug -LC:\Qt\Qt5.0.1\5.0.1\mingw47_32\lib -lQt5OpenGLd -lQt5Svgd -lQt5PrintSupportd -lQt5Widgetsd -lQt5Concurrentd -lQt5Guid -lQt5Cored -llibEGLd -llibGLESv2d -lgdi32 -luser32
    this produce the following errors :
    linking ../lib/qwtd.dll
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5OpenGLd
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Svgd
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5PrintSupportd
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Widgetsd
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Concurrentd
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Guid
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Cored
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibEGLd
    c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibGLESv2d
    collect2.exe: error: ld returned 1 exit status

    So, i tried manualy running the same command with C:\WinAVR\utils\bin\sh.exe but replacing the backslashes with slashes, and it worked...
    The problem is, when qmake detects a sh.exe, it tries to use it in the toolchain, but this winavr sh.exe does not like backslashes. I didn't try the MSYS shell.
    I found the following in qmake.conf (c:\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g++\qmake.conf):

    !isEmpty(QMAKE_SH) {
    MINGW_IN_SHELL = 1
    QMAKE_DIR_SEP = /
    include(../common/shell-unix.conf)
    } else {
    include(../common/shell-win32.conf)
    }

    and in spec_pre.prf (c:\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\features\s pec_pre.prf) :

    equals(QMAKE_HOST.os, Windows) {
    QMAKE_EXT_OBJ = .obj
    QMAKE_EXT_RES = .res
    QMAKE_SH =
    PATH = $$(PATH)
    PATH = $$split(PATH, ;)
    for(dir, PATH) {
    exists($$dir/sh.exe) {
    QMAKE_SH = $$dir/sh.exe
    break()
    }
    }
    unset(PATH)
    } else {
    QMAKE_EXT_CPP += .C
    QMAKE_EXT_H += .H
    QMAKE_EXT_OBJ = .o
    QMAKE_SH = sh
    }

    You comment these some lines to force qmake to use the windows shell, not the winavr shell, but it won't work, because mingw32-make also search for a shell, on my case it finds :
    find_and_set_shell() path search set default_shell = C:/WinAVR/utils/bin/sh.exe (from trace file , mingw32-make -d --trace > file)
    So, the easy solution is to temporarily remove winavr from path.... it works, i finaly managed to have qwt.dll and qwt.a compiled...

    I think (I am new to Qt, trying to move from BC++ to Qt) that the problem is within the Qt environment, perhaps in the c:\Users\......\AppData\Roaming\QtProject\qtcreato r\toolchains.xml or profiles.xml, where the pathes are stored with backslashes for the mingw conf. I tried to edit these files, but QtCreator put backslashes again each time i run it....).
    .
    Last edited by f8eho; 7th April 2013 at 15:22.

Similar Threads

  1. Putting text from QList to QLineEdit problem
    By "BumbleBee" in forum Newbie
    Replies: 1
    Last Post: 12th April 2012, 07:49
  2. Problem with qprocess and Path
    By pcoliver in forum Qt Programming
    Replies: 5
    Last Post: 18th September 2011, 11:16
  3. macdeployqt path problem
    By abey in forum Installation and Deployment
    Replies: 0
    Last Post: 10th December 2009, 10:46
  4. Replies: 8
    Last Post: 17th October 2009, 08:10
  5. QDir Path problem
    By ToddAtWSU in forum Qt Programming
    Replies: 3
    Last Post: 21st August 2008, 12:15

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
  •  
Qt is a trademark of The Qt Company.