Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Shared Library
Forum Updated to NodeBB v4.3 + New Features

Shared Library

Scheduled Pinned Locked Moved The Lounge
2 Posts 2 Posters 2.2k 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.
  • S Offline
    S Offline
    Shalini
    wrote on last edited by
    #1

    Hi ..
    I want to create a dll file and use the same dll in another Qt project ..
    Using Shared Library I have created dll .In another Qt Project I have included the Dll file . Dll path is specified in pro file ... I have included Dll file Debug folder ..When i debug the project I received warnings

    • redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]****

    kindly explain me reason for the issues ...
    Thanks In Advance ....

    1 Reply Last reply
    0
    • SeeLookS Offline
      SeeLookS Offline
      SeeLook
      wrote on last edited by SeeLook
      #2

      Did You add library import/export macros?

      Create a file, i.e.
      mylibimport.h

      #include <QtCore/QtGlobal>
      
      #if defined(MY_LIBRARY)
      #  define MYLIBRARY_EXPORT Q_DECL_EXPORT
      #else
      #  define MYLIBRARY_EXPORT Q_DECL_IMPORT
      #endif
      

      add definition to pro
      DEFINES += MY_LIBRARY

      Then add MYLIBRARY_EXPORT before every class or function visible outside:
      i.e:

      
      #include <mylibimport.h>
      class  MYLIBRARY_EXPORT someClass
      {
        //....
      };
      
       MYLIBRARY_EXPORT int someFunction() {
      }
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved