2

I have been coding in Qt for few years using MSVC and QtCreator on Windows.

Now I have decided to move to Linux environment and continue my development under Ubuntu. I then wish to compile the result on Windows machine for Windows executable, I expect no issues as the Qt code will be platform independent.

So I have all my .cpp, .ui, .h, .pro and other files on Ubuntu, I can compile it from Qt Creator or using command line, and now I wish to deploy for Windows too. How do I proceed? Do I copy all files on Windows machine every time and open project in QtCreator on Windows? Or can I automate this process somehow to be able to use e.g. a network-shared folder and avoid Windows Qt Creator modifying my code developed under Linux Qt Creator? There is lack of documentation when it comes to cross-platform deployment, yet this is the key feature advertised by Qt everywhere.

Is some code editing needed? What is the best approach in this scenario?

michnovka
  • 2,880
  • 3
  • 26
  • 58
  • "...a network-shared folder" No, synchronizing your code between computers is what version control systems are for. – MrEricSir Sep 29 '16 at 23:32
  • so I should simply use git and get the latest version in Win and then compile? Is that all it takes (+ of course add dependecies libs)? – michnovka Sep 29 '16 at 23:38
  • "so I should simply use git and get the latest version in Win and then compile?" .. yes ! – HazemGomaa Sep 29 '16 at 23:46

1 Answers1

2

By using version control e.g. git you commit on Linux env and then checkout and build manually on Windows.

And by setting up continuous integration on Windows e.g. Jenkins, Buildbot you can automate build process so that when you commit to version control on Linux the CI builds automatically on Windows.

Or you can use MXE to cross-compile on Linux for Windows.

Community
  • 1
  • 1
talamaki
  • 5,324
  • 1
  • 27
  • 40