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. Qt based lib with MFC/Qt apps
Forum Updated to NodeBB v4.3 + New Features

Qt based lib with MFC/Qt apps

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 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.
  • J Offline
    J Offline
    jpalbertini
    wrote on 20 Aug 2013, 14:03 last edited by
    #1

    Hi everyone,

    I am currently developing a cross platform library (Linux, Win32, MacOSX and android...), which will be used by some Qt and MFC apps (and others but these are the test apps).

    As for now, the library uses standard C++ library but I would like to be able to use Qt Objects in this lib (only non graphical components).

    In windows I use the MSVC10 Toolchain (with sln and vcxproj files), and for Linux/Mac/Android I use the Qt 5.1 Toolchain (with pro files).

    Is there a way to do that without having to compile Qt statically on each platform ?

    thanks for your replys :)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Aug 2013, 21:39 last edited by
      #2

      Hi,

      If I'm following you right, you are asking if it is possible to compile only one library working on all platforms ? In that case, no it's not possible.

      Also beware of the licensing implications, see "this":http://blog.qt.digia.com/blog/2009/11/30/qt-making-the-right-licensing-decision/

      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
      • P Offline
        P Offline
        pkj__
        wrote on 21 Aug 2013, 05:41 last edited by
        #3

        bq. Is there a way to do that without having to compile Qt statically on each platform ?

        Do what? Clarify.

        I undestand ur intention is to have one makefile generator and cross compile for mac, win and linux. The libraries loaded will be mfc in windows (CANNOT be used in linux n mac) and other similar in mac n linux. HOWEVER, i fail to understand, y with a windowing system as cute as qt, u still want to use MFC. And y r u statically building Qt?
        Still, for cross compiling, you can shift to cmake. You can cross compile as shown "here":http://www.cmake.org/Wiki/CMake_Cross_Compiling

        It is preferable though to have a VM and compile it there.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jpalbertini
          wrote on 21 Aug 2013, 07:34 last edited by
          #4

          thanks for your responses,

          bq. If I’m following you right, you are asking if it is possible to compile only one library working on all platforms ? In that case, no it’s not possible.

          In order to compile my lib on all my platforms I use some VMs which compile the code and commit the result on an svn

          bq. The libraries loaded will be mfc in windows (CANNOT be used in linux n mac) and other similar in mac n linux. HOWEVER, i fail to understand, y with a windowing system as cute as qt, u still want to use MFC. And y r u statically building Qt?

          Old softwares uses MFC and must be able to use the lib as well as new apps which are written with Qt. But I got that covered with two different builds (well two debug and two releases).

          in its current state the lib doesn't have Qt. What I want to know is if there is a way to use Qt in this lib without the need to link the final app to Qt.
          Can I include parts of the Qt Framework in my lib or do I need to put the needed Qt dlls in the subversion directory next to my lib...

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pkj__
            wrote on 21 Aug 2013, 08:28 last edited by
            #5

            If you use Qt apis then you need to have qt dlls. The only way to avoid 'showing the world that you have used qt' is to statically link against qt. But for that you will need the commercial version of qt, to do it legally.

            So, yes, you must have qt dlls next to your executable.

            MFC will work only on windows. If any part of your code even touches mfc, you can wish cross platform goodbye(if winelib is ignored). If you have cross compatible code like qt or need to include logic that mac versions include different set of libraries than linux or windows, etc. then go for cmake. It will make cross compiling easier.

            1 Reply Last reply
            0

            1/5

            20 Aug 2013, 14:03

            • Login

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