Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

multiple target patterns. Stop.



  • Hi all,

    I am a beginer with Qt511 under windows XP with Qtcreator 2.8.1 and mingW48_32
    I first try a console application "hello world", of course it works but when I add an external library without invoking it in the same code, I get this error : "Makefile.Debug:76: erreur : multiple target patterns. Stop."
    What does that mean and how to fix it ?

    Thanks

    Montin


  • Moderators

    How are you adding this external library? What have you changed in your project?



  • Thanks for your reply.

    I added it via the IDE (Right clic on the project and add a library, I tryed both the static and dynamic linking for windows only)

    Montin



  • he project that works:

    QT += core
    QT -= gui
    TARGET = Test_0
    CONFIG += console
    CONFIG -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp

    and the second that does not works :

    QT += core
    QT -= gui
    TARGET = Test_0
    CONFIG += console
    CONFIG -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/C:/MCC/CWIN/ -lcbw32
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/C:/MCC/CWIN/ -lcbw32d

    INCLUDEPATH += $$PWD/C:/MCC/CWIN
    DEPENDPATH += $$PWD/C:/MCC/CWIN

    win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/C:/MCC/CWIN/cbw32.lib
    else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/C:/MCC/CWIN/cbw32d.lib


  • Moderators

    Those 2 lines seem unnecessary:
    @
    win32:CONFIG: PRE_TARGETDEPS += $$PWD/C:/MCC/CWIN/cbw32.lib
    else:win32:CONFIG: PRE_TARGETDEPS += $$PWD/C:/MCC/CWIN/cbw32d.lib
    @



  • Thanks
    Without these lines it does not work. I have reinstalled qt51 and now it works but only in release mode in debug mode i get this error

    :-1: erreur : No rule to make target 'C:/qt/test/TestConsole0/../../../MCC/CWIN/cbw32d.lib', needed by 'debug\TestConsole0.exe'. Stop.

    ??

    Can you help ?
    Montin



  • I found a solution, maybe it is not the good one but it works.
    When adding the library cbw32.lib under qtcreator I had cheked the option "add the d suffix for debug" BUT the file cdw32d.lib is not existing in my environnement that's why I had this error. Now it works.
    Thanks sierdzio, with your reply, I did not feel alone with my problem ant it helps very much.
    Montin


Log in to reply