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. What is a platform independent qt addon?

What is a platform independent qt addon?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.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
    sirnoname
    wrote on last edited by
    #1

    Hello,

    I want to make a program which use plugins for hardware . All this hardware is serial port hardware and use QSerialport. In windows I do a DLL file and load this. Same with linux and .so files. However, I like to get a code that can be compiled without platform dependencies, a own dynamic library. Of course it must be compiled for different OS.

    Is there a solution?

    regards,
    SirNoName

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gyll
      wrote on last edited by
      #2

      There's no such thing as "platform-agnostic code" when it comes to using I/O. The best you can do is to isolate the platform-dependent code in your own classes (e.g. you can write your own library loader, serial port class, etc), and then your sole responsibility will be to maintain those classes for the platforms you want to support. I mean, do not expect to have serial ports, window managers, sound interfaces, etc in STL or the likes any time soon.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sirnoname
        wrote on last edited by
        #3

        I want to go this way:
        "http://www.codeproject.com/Articles/13501/Platform-Independent-Coding-DLLs-and-SOs":http://www.codeproject.com/Articles/13501/Platform-Independent-Coding-DLLs-and-SOs

        And QSerial port is a HW abstraction layer that works very well (until you make some code for the lock files in linux).
        However it seems there is a QLibrary which may solve the part in the codeproject article? Some platform independent loadlibrary function?
        I do not know :(

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Qt can already handle libraries and plugins in a platform independent way. They still need to be compile to match their platform (like the application itself), but your code would not need to change.

          See the help section on "How to create Qt Plugins" for details.

          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