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. Build project on Windows
Qt 6.11 is out! See what's new in the release blog

Build project on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 367 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.
  • P Offline
    P Offline
    ppitu
    wrote on last edited by
    #1

    Hi
    I have a project that contains (two subprojects) GUI applications and a library. I have been developing the project so far on Linux and everything has been fine. When I try to port the project to Windows and when I build it I get error undefined reference to all the functions from the library that I use in the GUI sub-project.

    How can I solve this problem?
    I am using CMake.

    My code:
    https://github.com/ppitu/ContractApp

    Christian EhrlicherC 1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #3

      You've defined the export/import preprocessor define CONTRACTAPPCORE_EXPORT, now you just have to use it in your classes. For example, in Pattern.h

      #include "../contractapp-core_global.h"
      
      class CONTRACTAPPCORE_EXPORT Pattern
      {
      public:
          explicit Pattern(int vector_size = 0);
      .
      .
      .
      
      P 1 Reply Last reply
      2
      • P ppitu

        Hi
        I have a project that contains (two subprojects) GUI applications and a library. I have been developing the project so far on Linux and everything has been fine. When I try to port the project to Windows and when I build it I get error undefined reference to all the functions from the library that I use in the GUI sub-project.

        How can I solve this problem?
        I am using CMake.

        My code:
        https://github.com/ppitu/ContractApp

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @ppitu said in Build project on Windows:

        How can I solve this problem?

        By reading Creating shared libraries and/or How to create a library with Qt and use it in an application.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        1
        • M Offline
          M Offline
          mchinand
          wrote on last edited by
          #3

          You've defined the export/import preprocessor define CONTRACTAPPCORE_EXPORT, now you just have to use it in your classes. For example, in Pattern.h

          #include "../contractapp-core_global.h"
          
          class CONTRACTAPPCORE_EXPORT Pattern
          {
          public:
              explicit Pattern(int vector_size = 0);
          .
          .
          .
          
          P 1 Reply Last reply
          2
          • M mchinand

            You've defined the export/import preprocessor define CONTRACTAPPCORE_EXPORT, now you just have to use it in your classes. For example, in Pattern.h

            #include "../contractapp-core_global.h"
            
            class CONTRACTAPPCORE_EXPORT Pattern
            {
            public:
                explicit Pattern(int vector_size = 0);
            .
            .
            .
            
            P Offline
            P Offline
            ppitu
            wrote on last edited by
            #4

            @mchinand
            Thanks :D

            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