|
|
Home » Community » Newbie corner » Compile for Unix on Windows?!?!?!?
|
Re: Compile for Unix on Windows?!?!?!? [message #38293 is a reply to message #38288] |
Sun, 09 December 2012 12:41 |
|
Hi Georgi,
It is often done the other way around (building for win on Linux), I don't remember ever hearing about anyone building for other systems on Windows. It might be possible if you can find a compiler supporting cross-compilation (maybe mingw could do that...).
The closest you can get easily is IMHO a virtual machine. With correct networking set-up of the virtual machine and build method for theide, you can even get as far as compiling the unix binaries in the windows theide. To achieve that you'd have to use something like "ssh <host> g++" as a compiler and share directories between the physical and virtual systems.
Best regards,
Honza
|
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38300 is a reply to message #38297] |
Sun, 09 December 2012 17:08 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Compiling an app on Win XP or 7 has worked on Linux Ubuntu without a problem so far. AFAIR
I have not used PostgreSQL or even know what it is.
You do need the proper dependencies for the OS and 32 or 64bit if there is a difference.
The only time I have run into something similar is in a java app that used jogl which is the java interface to native ogl or Open Graphic library.
The jogl files for 32bit are the same for win and linux.
There is a set for 64bit win and also a set for 64bit linux.
Whatever they use for Apple, Plum, Android or whatever I don't know.
I made a directory for each, 'jogl' for 32bit, jogl-64 for win 64bit and jogl-64L for linux 64 bit.
One executable works on win or linux 32 or 64bit.
In a .bat or .bash file for each it uses the proper jogl files with
-Djava.library.path=./jogl-64 or .../jogl-64L
For testing I always use a .bat file with pause as the last line to run it or a .bash with 'read -p "end" so if there is a problem you can see what it is.
Ubuntu is easy to install along side win. edit: make sure you the right 32 or 64bit.
Try compiling in win and then try and run it in linux or the other way around.
[Updated on: Sun, 09 December 2012 17:13] Report message to a moderator
|
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38308 is a reply to message #38302] |
Sun, 09 December 2012 19:19 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Yes.
"Ultimate++ is a C++ cross-platform rapid application development framework"
On Ubuntu just run it with wine.
If compiled on Linux maybe just add the .exe extension to run on Win. I have not done it in a while but whatever it is it is easy.
[Updated on: Sun, 09 December 2012 19:27] Report message to a moderator
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38312 is a reply to message #38297] |
Sun, 09 December 2012 21:15 |
|
nejnadusho wrote on Sun, 09 December 2012 16:21 | Can I install and run U++ on a virtual Linux machine?
If that is possible would it create the unix(exe) again in the 'Output Directory'?
| Yes, it is rather easy with VirtualBox or other virtualization tool. It will create the resulting binary in a directory inside the virtual machine. You can then copy it wherever you want.
nejnadusho wrote on Sun, 09 December 2012 16:21 | Also,in the post for windows compilation you mentioned that if there are external applications additional files might be necessary.
When compiling for unix what do I have to include if I am connecting to PostgreSQL?
| On Linux (also other unix-like systems) the software is usually installed and taken care of by package managers. So it is usually enough to just say to users that your software requires postgresql package to be installed and the will install it from their distribution repository. Furthermore, if you will distribute you software as a package, the package format usually lists all the other packages that it depends on and the manager will automatically install everything necessary.
Honza
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38313 is a reply to message #38308] |
Sun, 09 December 2012 21:20 |
|
nlneilson wrote on Sun, 09 December 2012 19:19 | "Ultimate++ is a C++ cross-platform rapid application development framework"
On Ubuntu just run it with wine.
If compiled on Linux maybe just add the .exe extension to run on Win. I have not done it in a while but whatever it is it is easy.
| Well, the "multiplatform" part refers actually to ability to compile on multiple platform. There is nothing special about U++
that would make it possible to run with wine on Linux, almost any windows application can do that.
It is a last resort possibility, whenever you can, please make a native Linux app, the users will be grateful
Honza
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38316 is a reply to message #38313] |
Sun, 09 December 2012 22:39 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
dolik.rce wrote on Sun, 09 December 2012 12:20 | make a native Linux app, the users will be grateful
Honza
|
Hi Honza
Yes I will make native Linux apps.
I don't recall what was required to compile an app in Linux and be able to run it on Win.
I had not installed Upp since installing Ubuntu 12.10 as I usually work on Win.
I just did on a 32bit like this and it worked OK.
http://www.ultimatepp.org/forum/index.php?t=msg&goto=367 19&&srch=ppa#msg_36719
On a 64bit this is the third try and not finished yet.
edit: It finally finished the install. This is on a quad core and core 4 and less on 3 they were hammered to 100%
After the set up pages it was the same for 3 and 4 until the install was finished, it took quite a while.
When compiling one of the tutorial apps some of the time all 4 cores were hammered to 100%.
It was very slow but it did work OK.
The second app tried compiled fast.
edit 2: Installed Upp on another 32bit computer with Ubuntu 12.10. Very fast compared to the 64bit and worked OK first try.
Good job of setting up and maintaining the ppa Honza.
[Updated on: Mon, 10 December 2012 00:32] Report message to a moderator
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38326 is a reply to message #38316] |
Mon, 10 December 2012 07:45 |
|
nlneilson wrote on Sun, 09 December 2012 22:39 | edit: It finally finished the install. This is on a quad core and core 4 and less on 3 they were hammered to 100%
After the set up pages it was the same for 3 and 4 until the install was finished, it took quite a while.
When compiling one of the tutorial apps some of the time all 4 cores were hammered to 100%.
It was very slow but it did work OK.
The second app tried compiled fast.
| The first build (or full rebuild) is always longer, because theide uses previous compiled files in subsequent builds. So the first build is slow and then it should be much faster The fact that all the CPUs were fully utilized is a good thing The build is parallel, to be as fast as possible. You can alter this in settings (HYDRA threads somewhere in Setup->Environment).
nlneilson wrote on Sun, 09 December 2012 22:39 | Good job of setting up and maintaining the ppa Honza.
| Thanks, it is good to hear someone actually uses it
Honza
|
|
|
Re: Compile for Unix on Windows?!?!?!? [message #38328 is a reply to message #38288] |
Mon, 10 December 2012 18:10 |
lectus
Messages: 329 Registered: September 2006 Location: Brazil
|
Senior Member |
|
|
I dual boot Windows and Linux, so I develop on both platforms.
But there are other alternatives:
1) Run Linux U++ and Windows U++ under Wine and compile for both.
2) Run Windows and compile for Windows. Run Linux inside VirtualBox and compile there for Linux.
Virtual machines are good option. They provide a clean, isolated development environment. You can test for example different linux distributions and see how your application behaves.
You can support for example:
Windows x86/x64
Linux x84/x64 .deb, .rpm, .taz.gz packages.
In this case definitely go for Virtual Machines!
[Updated on: Mon, 10 December 2012 18:13] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 03:05:52 CEST 2024
Total time taken to generate the page: 0.03507 seconds
|
|
|