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

No Rule to make target C:/...../x86Debug/lib/liblibcurl_a_debug.a, needed by debug/AlgoApplicationUI.exe. Stop



  • I just recently installed libcurl library and i am newer to C++ and libraries in general and i used the library installation wizard through QT but now i keep getting this error, I will attach my AlgoApplicationUi.pro code which if im correct is basically the makefile, just easier to edit.

    QT      += core gui
    QT      += core gui charts
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    TEMPLATE = app
    RC_FILE = myapp.rc.txt
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        MainWindow.cpp \
        login.cpp \
        main.cpp \
        webscrapper.cpp
    
    HEADERS += \
        MainWindow.h \
        login.h \
        webscrapper.h
    
    FORMS += \
        MainWindow.ui \
        login.ui \
    
    
    DISTFILES += \
        Contents/banner.qml
    
    RESOURCES += \
        res.qrc
    
    
    
    unix|win32: LIBS += -L$$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/ -llibcurl_a_debug
    
    INCLUDEPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    DEPENDPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    
    win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/libcurl_a_debug.lib
    else:unix|win32-g++: PRE_TARGETDEPS += $$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/liblibcurl_a_debug.a
    
    

    My include path to get the the folder that has curl.h is
    C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x86Debug_include\curl

    My .lib file path is
    C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x86Debug\lib\libcurl_a_debug


  • Lifetime Qt Champion

    Hi,

    You have a typo in your file. It's libcurl not liblibcurl.



  • @SGaist I appreciate the response! I changed it to

    unix|win32: LIBS += -L$$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/-libcurl_a_debug
    
    INCLUDEPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    DEPENDPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    
    win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/libcurl_a_debug.lib
    else:unix|win32-g++: PRE_TARGETDEPS += $$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/libcurl_a_debug.a
    
    

    and still getting the same compiler error? Any other noticeable errors you can think of?


  • Lifetime Qt Champion

    @Laner107 said in No Rule to make target C:/...../x86Debug/lib/liblibcurl_a_debug.a, needed by debug/AlgoApplicationUI.exe. Stop:

    unix|win32: LIBS += -L$$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/-libcurl_a_debug

    That also looks wrong. You are missing a space before the minus sign there and it's "-lcurl_a_debug"



  • @SGaist Okay so now I got

    
    unix|win32: LIBS += -L$$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/ -lcurl_a_debug
    
    INCLUDEPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    DEPENDPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    
    win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/libcurl_a_debug.lib
    else:unix|win32-g++: PRE_TARGETDEPS += $$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/libcurl_a_debug.a
    

    but still same error, I also appreciate your help in trying to fix this!


  • Lifetime Qt Champion

    I just realized, unless you are currently actively developing libcurl in parallel of your application, you shouldn't really need to use PRE_TARGETDEPS. Try building your application without it.

    It does not solve the problem at hand but should allow you to continue developing.



  • @SGaist So something like

    
    LIBS += -L$$PWD/../../Libraries/curl-7.69.1/x86Debug/lib/ -llibcurl_a_debug
    INCLUDEPATH += $$PWD/.ech./../Libraries/curl-7.69.1/x86Debug/_include/curl
    DEPENDPATH += $$PWD/../../Libraries/curl-7.69.1/x86Debug/_include/curl
    

  • Lifetime Qt Champion

    Drop the lib from libcurl_a_debug


Log in to reply