Results 1 to 5 of 5

Thread: Porting QT linux programs to windows. Use cygwin?

  1. #1
    Join Date
    May 2011
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Porting QT linux programs to windows. Use cygwin?

    Hi
    I am trying to port some QT sources from Unix to Windows. One of the apps is using rpc and sockets etc (the Unix way). Whats the best method I should use to port this across. Obviously I would like to minimize the changes I have to make to the code.

    Is one option to install cygwin and use that to build the application some how?
    Do I first need to build QT using cygwin?

    Or should I be looking at using a cross-compiler on linux to build the windows app?

    I'm just unsure of the best way to proceed.

    Can anyone give me any advice?
    Thanks

  2. #2
    Join Date
    Aug 2012
    Location
    Montreal
    Posts
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting QT linux programs to windows. Use cygwin?

    Like you said, using rpc and sockets is the Unix way. I personally don't know rpc very much, but I don't think there are any obvious ways of porting it to windows right away. Cygwin might be one option, but then you need to compile Qt for cygwin and deploy with the cygwin dll and even then I wouldn't be surprised to run into problems. If both processes are going to be on the same machine then QSharedMemory could help. Otherwise I would abstract your IPC code and code different implementations for the different platforms. On Windows, I have had some fair success using the NamedPipe family of functions. There are also other libraries that could help, including Boost.Interprocess.

  3. #3
    Join Date
    May 2011
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Porting QT linux programs to windows. Use cygwin?

    Thankyou for your help maximebd.

    I've been googling this problem for a while now. I have found sites where people have successfully, but with significant problems build QT using cygwin. I think those problems would have defeated me much sooner.
    I've not been able to find any proof that applications in general can relatively simply be ported across using cygwin and so I am going to chicken out for now.

    From what you are saying and from what I have read, it looks like cygwin is not really the answer that I am looking for (that is unless someone can tell me otherwise). Even if I can build QT with cygwin you indeed suggest that my applications may well not work anyway...so it looks like I need to port the platform dependent code over.
    To be quite honest, what I am doing is experimental, basically I am investigating how difficult it would be to port some of my QT apps across to windows. Most of them have gone across nicely, but one has a lot of platform dependent stuff in it. Some of this stuff could be re-written using QT and some of it I will have to look into windows native ways to do the job.

    So I am going to simply build my QT app with the platform dependent stuff compiled out (for now) and maybe port hem across later.

    Thanks again for your thoughts

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Porting QT linux programs to windows. Use cygwin?

    Qt has implementations for sockets (QAbstractSocket and subclasses) and for rpc (D-Bus). Why not rewrite the linux-dependent code to use the Qt classes and get that working, then look for a D-Bus implementation for Windows (like this one)? Then you've ported once and for all and can have something really platform independent.

    Personally, I use Visual Studio for all of my Windows coding; it's one less thing to worry about
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    May 2011
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Porting QT linux programs to windows. Use cygwin?

    Thanks d_stranz

    I will indeed try and do that. I have successfully compiled out all the dependent stuff. Will check it runs ok, and then will port stuff over...and where possible I will use qt independent code. When I get time I will look into trying visual studio to see how that cane help me.

    Thanks very much for your time

Similar Threads

  1. Linux to Windows Porting
    By qtprogrammer12345 in forum Qt Tools
    Replies: 1
    Last Post: 23rd May 2008, 07:28
  2. linux to windows porting issues
    By qtprogrammer12345 in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 06:45
  3. Porting Qt Application from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 7
    Last Post: 12th July 2007, 13:30
  4. Porting Qt application on windows from linux
    By safknw in forum Qt Programming
    Replies: 13
    Last Post: 22nd May 2006, 13:11
  5. Porting Qt3 linux app to windows qt4
    By Philip_Anselmo in forum Qt Programming
    Replies: 7
    Last Post: 15th May 2006, 18:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.