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. Cannot find <library path>: Permission Denied
Forum Updated to NodeBB v4.3 + New Features

Cannot find <library path>: Permission Denied

Scheduled Pinned Locked Moved Unsolved General and Desktop
32 Posts 5 Posters 8.3k 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.
  • L Laner107

    I have been trying to figure this out forever and cant seem to gete it to compile, i am trying to use libcurl library put keep getting the error in the title. I will provide my .pro code and also the compile output.

    .pro code

    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
    
    win32: LIBS += C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib\ -llibcurl
    
    INCLUDEPATH += C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\include\curl
    DEPENDPATH += C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\include\curl
    
    
    

    Compile Output

    23:11:02: Starting: "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" -j8
    C:\Qt\5.14.2\mingw73_64\bin\qmake.exe -o Makefile AlgoApplicationUI.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
    C:/Qt/Tools/mingw730_64/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Users/laner/Documents/GitHub/AlgoApp/Program/QT UI/AlgoApplicationUI'
    g++ -Wl,-subsystem,windows -mthreads -o debug\AlgoApplicationUI.exe debug/MainWindow.o debug/login.o debug/main.o debug/webscrapper.o debug/qrc_res.o debug/moc_MainWindow.o debug/moc_login.o  C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib -llibcurl C:\Qt\5.14.2\mingw73_64\lib\libQt5Charts.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Widgets.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Gui.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Core.a debug\myapp_res.o.txt  -lmingw32 C:\Qt\5.14.2\mingw73_64\lib\libqtmain.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-winx64\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 
    C:/Qt/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib: Permission denied
    C:/Qt/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibcurl
    collect2.exe: error: ld returned 1 exit status
    mingw32-make[1]: *** [Makefile.Debug:84: debug/AlgoApplicationUI.exe] Error 1
    mingw32-make: *** [Makefile:45: debug] Error 2
    mingw32-make[1]: Leaving directory 'C:/Users/laner/Documents/GitHub/AlgoApp/Program/QT UI/AlgoApplicationUI'
    23:11:08: The process "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project AlgoApplicationUI (kit: Desktop Qt 5.14.2 MinGW 64-bit)
    When executing step "Make"
    23:11:08: Elapsed time: 00:06.
    
    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by jsulm
    #2

    @Laner107 said in Cannot find <library path>: Permission Denied:

    LIBS += C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib\

    You forgot -L in front of the path:

    LIBS +=-LC:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib\
    

    -llibcurl most probably should be -lcurl
    Also you should use / instead of \ in pro files even on Windows.
    And it is a good idea to put paths into "" as they could contain spaces.

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

    L 1 Reply Last reply
    2
    • L Offline
      L Offline
      Laner107
      wrote on last edited by
      #3
      This post is deleted!
      1 Reply Last reply
      0
      • jsulmJ jsulm

        @Laner107 said in Cannot find <library path>: Permission Denied:

        LIBS += C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib\

        You forgot -L in front of the path:

        LIBS +=-LC:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib\
        

        -llibcurl most probably should be -lcurl
        Also you should use / instead of \ in pro files even on Windows.
        And it is a good idea to put paths into "" as they could contain spaces.

        L Offline
        L Offline
        Laner107
        wrote on last edited by
        #4

        @jsulm I appreciate the response, well I made the changes and it compiled but now im getting a couple undefinded reference errors, my code is below if you would like to take a look at my class.

        class CurlObj
        {
        public:
            CurlObj (string url)
            {
                curl = curl_easy_init();
                if (!curl) {
                    throw string ("Curl did not initialize.");
                }
        
                curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &CurlObj::curlWriter);
                curl_easy_setopt(curl, CURLOPT_WRITEDATA, &curlBuffer);
                curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
                curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
                curl_easy_perform(curl);
            };
        
            static int curlWriter(char *data, int size, int nmemb, std::string *buffer)
            {
                int result = 0;
                if (buffer != NULL) {
                    buffer->append(data, size * nmemb);
                    result = size * nmemb;
                }
        
                return result;
            }
        
            std::string getData()
            {
                return curlBuffer;
            }
        
        protected:
            CURL * curl;
            std::string curlBuffer;
        };
        

        The errors are "undefined reference to 'imp_curl_easy_init' and 'imp_curl_easy_setop'" any idea why this would be?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #5

          Hi,

          What exact error are you getting ?
          Might be a silly question but are you sure that libcurl really is in 64 bit format ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            What exact error are you getting ?
            Might be a silly question but are you sure that libcurl really is in 64 bit format ?

            L Offline
            L Offline
            Laner107
            wrote on last edited by
            #6

            @SGaist Yes it is I built it using x64 native tools vs command prompt and took the .lib and .include folders from the build, and i posted the errors below the code,

            The errors are "undefined reference to 'imp_curl_easy_init' and 'imp_curl_easy_setop'" any idea why this would be?

            jsulmJ 1 Reply Last reply
            0
            • L Laner107

              @SGaist Yes it is I built it using x64 native tools vs command prompt and took the .lib and .include folders from the build, and i posted the errors below the code,

              The errors are "undefined reference to 'imp_curl_easy_init' and 'imp_curl_easy_setop'" any idea why this would be?

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

              @Laner107 said in Cannot find <library path>: Permission Denied:

              any idea why this would be?

              Either these functions are not in the lib you're linking or the lib is not found/not compatible.
              Do you now use -lcurl instead of -llibcurl ?

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

              L 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Laner107 said in Cannot find <library path>: Permission Denied:

                any idea why this would be?

                Either these functions are not in the lib you're linking or the lib is not found/not compatible.
                Do you now use -lcurl instead of -llibcurl ?

                L Offline
                L Offline
                Laner107
                wrote on last edited by
                #8

                @jsulm No because the filename is libcurl? And this code is straight from github so I know it should work.

                jsulmJ 1 Reply Last reply
                0
                • L Laner107

                  @jsulm No because the filename is libcurl? And this code is straight from github so I know it should work.

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

                  @Laner107 said in Cannot find <library path>: Permission Denied:

                  No because the filename is libcurl?

                  It doesn't matter, when using -l you do not specify the prefix (lib) and you do not specify file name extension (dll, so). At least it is like this on UNIX/Linux.

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

                  L 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Laner107 said in Cannot find <library path>: Permission Denied:

                    No because the filename is libcurl?

                    It doesn't matter, when using -l you do not specify the prefix (lib) and you do not specify file name extension (dll, so). At least it is like this on UNIX/Linux.

                    L Offline
                    L Offline
                    Laner107
                    wrote on last edited by
                    #10

                    @jsulm So now its saying, "cannot find -lcurl" so i assume for windows we keep the actual name? And if its not that do you have any idea why it would be giving me the undefined errors even though they are in the library, and how do i know if its not compaitable?

                    jsulmJ 1 Reply Last reply
                    0
                    • L Laner107

                      @jsulm So now its saying, "cannot find -lcurl" so i assume for windows we keep the actual name? And if its not that do you have any idea why it would be giving me the undefined errors even though they are in the library, and how do i know if its not compaitable?

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

                      @Laner107 said in Cannot find <library path>: Permission Denied:

                      And if its not that do you have any idea why it would be giving me the undefined errors even though they are in the library

                      I already wrote that this is either:

                      • Those functions are not in that lib, or
                      • The lib is not found, or
                      • The lib is not compatible (built with different compiler or for different architecture)

                      Can you post the whole build log?

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

                      L 1 Reply Last reply
                      2
                      • jsulmJ jsulm

                        @Laner107 said in Cannot find <library path>: Permission Denied:

                        And if its not that do you have any idea why it would be giving me the undefined errors even though they are in the library

                        I already wrote that this is either:

                        • Those functions are not in that lib, or
                        • The lib is not found, or
                        • The lib is not compatible (built with different compiler or for different architecture)

                        Can you post the whole build log?

                        L Offline
                        L Offline
                        Laner107
                        wrote on last edited by
                        #12

                        @jsulm Is this the log you are looking for?

                        14:55:14: Running steps for project AlgoApplicationUI...
                        14:55:14: Configuration unchanged, skipping qmake step.
                        14:55:14: Starting: "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" -j8
                        C:/Qt/Tools/mingw730_64/bin/mingw32-make -f Makefile.Debug
                        mingw32-make[1]: Entering directory 'C:/Users/laner/Documents/GitHub/AlgoApp/Program/QT UI/AlgoApplicationUI'
                        g++ -Wl,-subsystem,windows -mthreads -o debug\AlgoApplicationUI.exe debug/MainWindow.o debug/login.o debug/main.o debug/webscrapper.o debug/qrc_res.o debug/moc_MainWindow.o debug/moc_login.o  -LC:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib -llibcurl C:\Qt\5.14.2\mingw73_64\lib\libQt5Charts.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Widgets.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Gui.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Core.a debug\myapp_res.o.txt  -lmingw32 C:\Qt\5.14.2\mingw73_64\lib\libqtmain.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-winx64\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 
                        debug/MainWindow.o: In function `CurlObj::CurlObj(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
                        C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:37: undefined reference to `__imp_curl_easy_init'
                        C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:42: undefined reference to `__imp_curl_easy_setopt'
                        C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:43: undefined reference to `__imp_curl_easy_setopt'
                        C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:44: undefined reference to `__imp_curl_easy_setopt'
                        C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:45: undefined reference to `__imp_curl_easy_setopt'
                        C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:46: undefined reference to `__imp_curl_easy_perform'
                        collect2.exe: error: ld returned 1 exit status
                        mingw32-make[1]: *** [Makefile.Debug:84: debug/AlgoApplicationUI.exe] Error 1
                        mingw32-make: *** [Makefile:45: debug] Error 2
                        mingw32-make[1]: Leaving directory 'C:/Users/laner/Documents/GitHub/AlgoApp/Program/QT UI/AlgoApplicationUI'
                        14:55:16: The process "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" exited with code 2.
                        Error while building/deploying project AlgoApplicationUI (kit: Desktop Qt 5.14.2 MinGW 64-bit)
                        When executing step "Make"
                        
                        JonBJ 1 Reply Last reply
                        0
                        • L Laner107

                          @jsulm Is this the log you are looking for?

                          14:55:14: Running steps for project AlgoApplicationUI...
                          14:55:14: Configuration unchanged, skipping qmake step.
                          14:55:14: Starting: "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" -j8
                          C:/Qt/Tools/mingw730_64/bin/mingw32-make -f Makefile.Debug
                          mingw32-make[1]: Entering directory 'C:/Users/laner/Documents/GitHub/AlgoApp/Program/QT UI/AlgoApplicationUI'
                          g++ -Wl,-subsystem,windows -mthreads -o debug\AlgoApplicationUI.exe debug/MainWindow.o debug/login.o debug/main.o debug/webscrapper.o debug/qrc_res.o debug/moc_MainWindow.o debug/moc_login.o  -LC:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib -llibcurl C:\Qt\5.14.2\mingw73_64\lib\libQt5Charts.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Widgets.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Gui.a C:\Qt\5.14.2\mingw73_64\lib\libQt5Core.a debug\myapp_res.o.txt  -lmingw32 C:\Qt\5.14.2\mingw73_64\lib\libqtmain.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-winx64\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 
                          debug/MainWindow.o: In function `CurlObj::CurlObj(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
                          C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:37: undefined reference to `__imp_curl_easy_init'
                          C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:42: undefined reference to `__imp_curl_easy_setopt'
                          C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:43: undefined reference to `__imp_curl_easy_setopt'
                          C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:44: undefined reference to `__imp_curl_easy_setopt'
                          C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:45: undefined reference to `__imp_curl_easy_setopt'
                          C:\Users\laner\Documents\GitHub\AlgoApp\Program\QT UI\AlgoApplicationUI/MainWindow.cpp:46: undefined reference to `__imp_curl_easy_perform'
                          collect2.exe: error: ld returned 1 exit status
                          mingw32-make[1]: *** [Makefile.Debug:84: debug/AlgoApplicationUI.exe] Error 1
                          mingw32-make: *** [Makefile:45: debug] Error 2
                          mingw32-make[1]: Leaving directory 'C:/Users/laner/Documents/GitHub/AlgoApp/Program/QT UI/AlgoApplicationUI'
                          14:55:16: The process "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" exited with code 2.
                          Error while building/deploying project AlgoApplicationUI (kit: Desktop Qt 5.14.2 MinGW 64-bit)
                          When executing step "Make"
                          
                          JonBJ Online
                          JonBJ Online
                          JonB
                          wrote on last edited by JonB
                          #13

                          @Laner107
                          Every example on the web (gcc) uses -lcurl, not -llibcurl. I don't think that would change for Windows, unless you have something which says that? It concerns me you say that generates "cannot find -lcurl". Do you want to tell us what exactly there is in C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib that looks something like libcurl.a?

                          L 1 Reply Last reply
                          0
                          • JonBJ JonB

                            @Laner107
                            Every example on the web (gcc) uses -lcurl, not -llibcurl. I don't think that would change for Windows, unless you have something which says that? It concerns me you say that generates "cannot find -lcurl". Do you want to tell us what exactly there is in C:\Users\laner\Documents\GitHub\AlgoApp\Program\Libraries\curl-7.69.1\x64Release\lib that looks something like libcurl.a?

                            L Offline
                            L Offline
                            Laner107
                            wrote on last edited by
                            #14

                            @JonB Pictures of my folder explorer as well as descriptions

                            JonBJ 1 Reply Last reply
                            0
                            • L Laner107

                              @JonB Pictures of my folder explorer as well as descriptions

                              JonBJ Online
                              JonBJ Online
                              JonB
                              wrote on last edited by JonB
                              #15

                              @Laner107
                              You don't have file extensions visible (!), but that looks like a .lib file to me, where I was expecting a .a. I think mingw now links against *.lib files, and that might be where the difference bewteen -lcurl vs -llibcurl comes from.

                              This is getting beyond my pay-grade. Wherever it came from, it's for gcc/mingw, not for msvc, is it? Did you build it or download it? Did the instructions relate to using msvc or mingw as the compiler/linker? I don't have the answers, just thoughts for you....

                              L 1 Reply Last reply
                              0
                              • JonBJ JonB

                                @Laner107
                                You don't have file extensions visible (!), but that looks like a .lib file to me, where I was expecting a .a. I think mingw now links against *.lib files, and that might be where the difference bewteen -lcurl vs -llibcurl comes from.

                                This is getting beyond my pay-grade. Wherever it came from, it's for gcc/mingw, not for msvc, is it? Did you build it or download it? Did the instructions relate to using msvc or mingw as the compiler/linker? I don't have the answers, just thoughts for you....

                                L Offline
                                L Offline
                                Laner107
                                wrote on last edited by
                                #16

                                @JonB I built it but im sure I got something messed up with the building of it, is there a suitable way to build libraries using QT or what would you recomend me doing to get this library to work?

                                JonBJ 1 Reply Last reply
                                0
                                • L Laner107

                                  @JonB I built it but im sure I got something messed up with the building of it, is there a suitable way to build libraries using QT or what would you recomend me doing to get this library to work?

                                  JonBJ Online
                                  JonBJ Online
                                  JonB
                                  wrote on last edited by
                                  #17

                                  @Laner107
                                  As I said, I don't know this stuff, I'm only guessing. I'll have to leave it for others to help.

                                  My last quick test thought is: try recompiling your application sources (not the curl ones) with -DCURL_STATICLIB flag, and then relink. This may be nonsense or may make no difference. Worth a try. Then I'm afraid I'm bowing out.

                                  L 1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    MrShawn
                                    wrote on last edited by
                                    #18

                                    Usually when linking libs in .pro files with the -l, I don't have good luck. To get it to work a lot of times I will link the lib file itself.

                                    Here is an example of what I mean.

                                    INCLUDEPATH += "$$PWD/vlc-qt/include"
                                    
                                    LIBS += "$$PWD/vlc-qt/libs/mingw64/libVLCQtQml.dll"
                                    LIBS += "$$PWD/vlc-qt/libs/mingw64/libVLCQtCore.dll"
                                    

                                    This will build but I have issues when I run. I usually have to copy the .dlls into the application's build directory (the same folder as the .exe file that is built).

                                    L 2 Replies Last reply
                                    0
                                    • M MrShawn

                                      Usually when linking libs in .pro files with the -l, I don't have good luck. To get it to work a lot of times I will link the lib file itself.

                                      Here is an example of what I mean.

                                      INCLUDEPATH += "$$PWD/vlc-qt/include"
                                      
                                      LIBS += "$$PWD/vlc-qt/libs/mingw64/libVLCQtQml.dll"
                                      LIBS += "$$PWD/vlc-qt/libs/mingw64/libVLCQtCore.dll"
                                      

                                      This will build but I have issues when I run. I usually have to copy the .dlls into the application's build directory (the same folder as the .exe file that is built).

                                      L Offline
                                      L Offline
                                      Laner107
                                      wrote on last edited by
                                      #19

                                      @JonB Its okay i thank you for the help!!

                                      @MrShawn I am quite new to the idea of building and using libraries, I notice there is an actuall folder for the libraries under mingw, I decided to store my one library im using in its own folder someone else, will this effect anything or should i keep it in mingw folder? And also where can i find the .dll files for my library i built as i can only find the .lib file and include folder?

                                      1 Reply Last reply
                                      0
                                      • M MrShawn

                                        Usually when linking libs in .pro files with the -l, I don't have good luck. To get it to work a lot of times I will link the lib file itself.

                                        Here is an example of what I mean.

                                        INCLUDEPATH += "$$PWD/vlc-qt/include"
                                        
                                        LIBS += "$$PWD/vlc-qt/libs/mingw64/libVLCQtQml.dll"
                                        LIBS += "$$PWD/vlc-qt/libs/mingw64/libVLCQtCore.dll"
                                        

                                        This will build but I have issues when I run. I usually have to copy the .dlls into the application's build directory (the same folder as the .exe file that is built).

                                        L Offline
                                        L Offline
                                        Laner107
                                        wrote on last edited by
                                        #20

                                        @MrShawn It also appear under my build settings that the build configuration is Debug and the make is a mingw32-make.exe, so does that mean my library is suppose to be a debug .lib that is also x32 instead of x64? This is all quite overwhelming and confusing and sorry if Im being a hassle.

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • JonBJ JonB

                                          @Laner107
                                          As I said, I don't know this stuff, I'm only guessing. I'll have to leave it for others to help.

                                          My last quick test thought is: try recompiling your application sources (not the curl ones) with -DCURL_STATICLIB flag, and then relink. This may be nonsense or may make no difference. Worth a try. Then I'm afraid I'm bowing out.

                                          L Offline
                                          L Offline
                                          Laner107
                                          wrote on last edited by
                                          #21

                                          @JonB ALso where do i input the -DCURL_STATICLIB flag at? And do i need to download .dll files and put them into the mingw folder or since its a static library is it okay?

                                          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