Results 1 to 3 of 3

Thread: [Qt Creator / qmake] - linking shared libraries on Windows

  1. #1
    Join Date
    May 2011
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default [Qt Creator / qmake] - linking shared libraries on Windows

    Hi,
    I've got a problem. It is probably pretty simple, but I can't find any answer on the net.
    I'm working on shared library that depends on other shared libraries. I've added header files in qmake and tried many times to link other dll but failed.
    So in theory there is something I called 'my.dll' - it's the one i'm developing and an 'external.dll'
    I tried:
    Qt Code:
    1. LIBS += -L../external -lexternal
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. LIBS += ../external/external.dll
    To copy to clipboard, switch view to plain text mode 
    and many other but I am still getting error
    external: No such file or directory
    at the place where in my code is line:
    Qt Code:
    1. #include <external>
    To copy to clipboard, switch view to plain text mode 
    Please, help me!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: [Qt Creator / qmake] - linking shared libraries on Windows

    The error message is coming from your C++ pre-processor and has nothing to do with your linker (which is what consumes the LIBS options). This line:
    Qt Code:
    1. #include <external>
    To copy to clipboard, switch view to plain text mode 
    tells the pre-processor that there is a file literally called "external" and that it should be searched for on the system include path (and not in the current directory first). The error is telling you this is not correct.

    Chances are that the file is actually called "external.h" and that it does not exist on the system include path but in the source directory your external library was built from. You can adjust the path searched by the pre-processor using the INCLUDEPATH variables in your PRO file, or you can specify the location of the file like:
    Qt Code:
    1. #include "external.h"
    2. #include "../external/external.h"
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2011
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Qt Creator / qmake] - linking shared libraries on Windows

    Thank you ! I've lost about 5 hours thanks to my own stupidity

Similar Threads

  1. Replies: 10
    Last Post: 20th December 2015, 11:14
  2. Qt Creator Mac/Windows VM shared build
    By mmat in forum Installation and Deployment
    Replies: 1
    Last Post: 15th July 2013, 06:25
  3. Replies: 2
    Last Post: 10th December 2010, 07:54
  4. Replies: 2
    Last Post: 31st October 2009, 03:41
  5. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.