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. Statically-built Qt4.8.4 cannot build DLL for a Shared Library
Forum Updated to NodeBB v4.3 + New Features

Statically-built Qt4.8.4 cannot build DLL for a Shared Library

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.9k 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.
  • C Offline
    C Offline
    Code_ReaQtor
    wrote on last edited by
    #1

    Greetings!

    I built Qt 4.8.4 statically with msvc...

    Here are the commands I used in building:
    @configure -static -debug-and-release
    nmake sub-src@

    Successfully built it. and it works.

    I got the only problem when building a Shared Library that I wrote. AFAIK, building shared libs supposedly output dll files.
    This "link":http://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries explains the difference between static and shared libraries.

    Although my applications work when linking them to my library but getting LNK4217 warnings.

    should i build another Qt in -shared configuration (since -shared-and-static is mac osx specific)

    What i want to get from it is that I have a static MyApp.exe linked to MyLib.dll and these 2 files are present when I deploy my application. (MyApp.exe will not work without MyLib.dll)

    Thanks and more powers!

    Please visit my open-source projects at https://github.com/Code-ReaQtor.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      Hi,

      I dont know whether this will be of any help, there are few tutorials on "How to Create a DLL":http://voidrealms.com/viewtutorial.aspx?id=243 , "How to use a DLL":http://voidrealms.com/viewtutorial.aspx?id=244 and "Static Libary":http://voidrealms.com/viewtutorial.aspx?id=245 . You can take a look at these tutorials that explains the basics of creating a static library.

      Regards
      Soumitra.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Code_ReaQtor
        wrote on last edited by
        #3

        OK, I found out that statically built Qt cannot produce dll files which can only be produced with "shared Qt". Though you can link a "statically-built" app with a "shared-built" dll/library file, you may end up adding the QtGui, QtCore, etc DLLS since it is needed by your generated library.

        Thanks for the link though. One of these days I will try to read those. Cheers and more powers!

        PS. I will not YET mark this thread as [solved]. I am waiting for other devs to post if they found solution to this problem.

        Please visit my open-source projects at https://github.com/Code-ReaQtor.

        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