I'm working under Windows and I'm looking for a simple solution that could make me able to cross compile for both Windows and Linux.
I've found this topic :
But the reference of the answer is broken and I don't understand it very well.
I'm using QtCreator and what I want is a kit with something that gives me a Windows executable and another kit with which I would have a executable for Linux.
So far I've been using the Visual Studio compiler MSVC on one kit. That gives me a compilation for Windows.
I'm using MinGW with GCC on another kit. I hoped it could give me a Linux executable. But this gives me a Windows executable too.
How can I get a compiler that could work under QtCreator on Windows and generate Linux executable ?
I've found a solution a long time ago so I'm posting it. Maybe it could be useful.
I've used Cygwin and Crosstools. This makes me able to cross-compile for Linux while being under Windows.
Related
Background:
Im using QT and have visual studio 2012 as my IDE (used the QT plugin for visual studio).
And finally the whole project is done. However due to my .NET background I have no experience when it comes to deploying my project so it can be run on Linux.
Question:
Anyone knowing how to deploy a QT project made in visual studio to linux?
You should install Linux and prepare a Qt development environment on it.You can then copy your project there, compile it and see the results in the real environment. This way you can cope with the minor differences when porting from one OS to another easily.
So don't think of cross compiling your app for Linux on Windows. From a complexity point of view, I think setting up a Linux machine (VM or not) and the necessary environment for Qt is a whole lot simpler than cross compiling bug hunting afterwards. After all you will need a real target environment to finally test your application.
Before you can deploy something you have to compile it for that platform, and here you have two main choiches: either you cross-compile which means you compile it on windows using a set of tools so that your software is built to run on a linux, or you get a linux machine, you copy your entire project over and let Qt for linux do the magic.
Once you have your working binary compiled on linux or for linux then you start thnking about deployoment.
If you really want to be fully linux-compatible and "linux-ally correct" you should distribute your source-code precooked using some tools like "automake" that will make it possible to linux users to compile it on any linux version.
If you do not want to release your source code, you technically can distribute binaries without source code (not sure if you will be ok with licenses) but you have to be aware that there is no standard in linux for distributing binary packages, there are at least 2 main package building standards that are the ubuntu/debian style and red hat (and friends) style.
You are going to find plenty of documentation about all this stuff from cross-compile to automake and of course building debian packages and building red hat rpm packages.
I looked all over on google but I can only find answers for unix systems or windows with cygwin. I want to be able to use clang_complete on windows without cygwin.
Is it possible to get clang_complete to work on windows without cygwin? I've installed clang_complete with pathogen. But I know I need clang and llvm itself, but I don't know how I could install clang and llvm and make it portable so it works anywhere. (such as a usb drive, etc) I've already gotten vim and gvim to work on the usb drive by just copying the folder that vim was installed to and putting it on the drive, but I need help getting clang_complete to work.
Thanks.
At this stage, you'll probably need to compile Clang yourself from either MinGW/MSys environment or through MSVC. It will probably still be quite buggy at the moment. Note that libc++, Clang's C++ runtime, is not ported to Windows yet, so you're stuck with an old, pre-C++11 version of gcc 4.2's libstdc++.
Also, I don't think it is currently possible to relocate Clang — it uses fixed paths for things like includes and libraries.
I have previously used the GNU FORTRAN compiler gfortran. But since the Intel FORTRAN compiler for Linux is available for personal non-commercial use I decided to give it a try. Is it possible to use it under Cygwin? I wouldn't know where to begin to get it to work, so all help is welcome.
My earlier comment turned into an answer of sorts ...
At first glance an interesting question. But what will you do with the executables that the compiler creates, if you manage to get that far ? I doubt that you will, but if you did you would have a Linux executable on a Windows platform (and cross-compiling for Windows from Linux is not supported by the Intel compiler). Don't forget that Cygwin is not Linux, it's a (DOS/Windows) program that provides Windows users with some of the facilities that Linux provides its users. To run an executable from the Cygwin command line the executable must have been built for DOS/Windows.
You might, and I have no experience either way, get further installing a Linux VM on your Windows PC and installing the compiler on the VM. You're still not going to get Windows executables out of a Linux compiler, but you would get, if success greeted you, executables running under the VM.
I have a little application running on Linux and want to port it to Windows. I found that with Cygwin i will be able to do it simple by linking the application with the cygwin1.dll library which make available a lot of the POSIX and other standard functions. I read the FAQ and the User Guide on the site of Cygwin but didn't find or didn't understand how can I link my source with this library.
My application uses GTK+ and I successfully compiled and link it on Windows with MinGW but I have to disable some of the functionality .Now that I find Cygwin I would like to link with it to make available again this functionality.
Generally you compile your source inside of Cygwin to produce the Windows binary. I'm pretty sure Cygwin will take care of linking to the proper dlls for you.
When you finally get the binary compiled, make sure that the cygwin1.dll is in the PATH specified by Windows.
I am developing a cross-platform application in C++ in VS2005. I already know how to run a remote process on a windows box, attach it, and debug from my VS.
Is there a way to do debug a running process on Linux for example? What about other *nix platforms such as Solaris or AIX? I can do emacs+gdb, but if this can be done from VS I'd prefer that.
VS2005 and g++ use create completely different debugging symbols. You do realize you'll have to compile the application on linux with g++? (or some other *nix compiler, but not VS2005). So because it's compiled with a different compiler, there's really no way to debug it inside VS2005.
OK, everything I said was essentially true, but it looks like there is a program that will allow you to run gdb inside Visual Studio. Check it out here.