Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to include files from the subproject dll library in a unit testing subproject
Qt 6.12 LTS is out! See what's new in the release blog

How to include files from the subproject dll library in a unit testing subproject

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 696 Views 2 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
    Stanislav228
    wrote on last edited by
    #1

    Hi! I have a project with subprojects. One of the subprojects is a dll library that I'm developing (which means that some of the classes inside the dll library have q_decl_export). I'm trying to connect the classes from the dll subproject to the unit testing subproject. Everything works until I add the q_decl_export directive to the classes in the dll. What should I do? I want to connect the files from the dll subproject to the unit testing project as a dynamic library. In this case, all classes in the dll will need to be added with q_decl_export. However, I do not want all classes to be accessible from the dll.

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

      Hi and welcome to devnet,

      How did you add these macros ?
      Did you properly follow the documentation on this subject ?

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

      1 Reply Last reply
      0
      • S Stanislav228

        Hi! I have a project with subprojects. One of the subprojects is a dll library that I'm developing (which means that some of the classes inside the dll library have q_decl_export). I'm trying to connect the classes from the dll subproject to the unit testing subproject. Everything works until I add the q_decl_export directive to the classes in the dll. What should I do? I want to connect the files from the dll subproject to the unit testing project as a dynamic library. In this case, all classes in the dll will need to be added with q_decl_export. However, I do not want all classes to be accessible from the dll.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @Stanislav228

        Hi and welcome to the forum,

        I don't quite understand your issue. You don't need to add the EXPORT to all functions/classes of your library. You can still hide some classes or functions that you don't want in your target that imports the lib.

        Everything works until I add the q_decl_export directive to the classes in the dll. What should I do?

        What does not work then?! How do you add the import/export directives to your project? Are you using the "Qt-Global" style?!


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        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
        • Unsolved