Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Compile for Unix on Windows?!?!?!?
Compile for Unix on Windows?!?!?!? [message #38288] Sun, 09 December 2012 05:19 Go to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Hi,

Is it possible to create UNIX executable by compiling in Windows?
How?

I mean here in U++.

Thank you.


Best,
Georgi



Re: Compile for Unix on Windows?!?!?!? [message #38293 is a reply to message #38288] Sun, 09 December 2012 12:41 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 #38297 is a reply to message #38288] Sun, 09 December 2012 16:21 Go to previous messageGo to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Honza,

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'?

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?

Thank you.

Best,
Georgi
Re: Compile for Unix on Windows?!?!?!? [message #38300 is a reply to message #38297] Sun, 09 December 2012 17:08 Go to previous messageGo to next message
nlneilson is currently offline  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 #38302 is a reply to message #38288] Sun, 09 December 2012 18:03 Go to previous messageGo to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
nlneilson,

Are you suggesting I could just run the .exe on UNIX and it will work?


Best,
Georgi
Re: Compile for Unix on Windows?!?!?!? [message #38308 is a reply to message #38302] Sun, 09 December 2012 19:19 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Yes.

"Ultimate++ is a C++ cross-platform rapid application development framework" Smile

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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

nlneilson wrote on Sun, 09 December 2012 19:19

"Ultimate++ is a C++ cross-platform rapid application development framework" Smile

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 Wink

Honza
Re: Compile for Unix on Windows?!?!?!? [message #38316 is a reply to message #38313] Sun, 09 December 2012 22:39 Go to previous messageGo to next message
nlneilson is currently offline  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 Wink

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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Wink The fact that all the CPUs were fully utilized is a good thing Wink 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 Smile

Honza
Re: Compile for Unix on Windows?!?!?!? [message #38328 is a reply to message #38288] Mon, 10 December 2012 18:10 Go to previous messageGo to next message
lectus is currently offline  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

Re: Compile for Unix on Windows?!?!?!? [message #38330 is a reply to message #38328] Mon, 10 December 2012 18:55 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
That would be handy rather than rebooting to switch OS.

I installed Oracle VM VirtualBox to try an Android setup.
Never got that working but didn't spend much time tinkering.

Do you know a link for the VirtualMachine download and setup that works OK. I have looked at several, tried a few but got nowhere.
Re: Compile for Unix on Windows?!?!?!? [message #38332 is a reply to message #38330] Mon, 10 December 2012 19:55 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
I previously looked at and just now tried the M$ disk2vhd but the opening box does not show the ubuntu directory.

Tinkering with something that may effect my main OS is not what I want to do without knowing more. Got bit doing that twice before.
Re: Compile for Unix on Windows?!?!?!? [message #38334 is a reply to message #38332] Tue, 11 December 2012 08:43 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Got Ubuntu running in VirtualBox.

Here are a couple links
http://www.psychocats.net/ubuntu/virtualbox
http://mikesmithers.wordpress.com/2011/03/23/installing-ubun tu-in-virtualbox-on-a-windows-7-host/

Needs to be tuned up as very slow, cannot access host, mouse jumps sometimes, scroll wheel is not working, etc.

If the OP nejnadusho does this he will have access to a Linux OS.

A VirtualMachine has advantages but ....

[Updated on: Tue, 11 December 2012 08:54]

Report message to a moderator

Re: Compile for Unix on Windows?!?!?!? [message #38336 is a reply to message #38334] Tue, 11 December 2012 12:58 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Neil

You can try VMWare. In my case and for other people it runs Linux on Windows (XP or 7) faster than VirtualBox.


Best regards
Iñaki
Re: Compile for Unix on Windows?!?!?!? [message #38340 is a reply to message #38336] Tue, 11 December 2012 16:42 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Hi Koldo

Thanks for the suggestion, I will try VMWare.

The BIOS/System has been enabled for VM so it should be easier.
Re: Compile for Unix on Windows?!?!?!? [message #38341 is a reply to message #38336] Tue, 11 December 2012 19:55 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
VMWare works good.
A few glitches like cannot access host, little slower than regular install, etc but very usable.

After getting gnome, wine, synaptic, etc set up the Upp ppa, installed and run a couple of the tutorials.

I will ckeck on what is necessary to access files on host.

Thanks again Koldo
Re: Compile for Unix on Windows?!?!?!? [message #38356 is a reply to message #38341] Wed, 12 December 2012 08:28 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Neil

You will need "VMWare Tools" installed to have access to host files and automatic window resizing.


Best regards
Iñaki
Re: Compile for Unix on Windows?!?!?!? [message #38361 is a reply to message #38288] Wed, 12 December 2012 13:29 Go to previous messageGo to next message
lectus is currently offline  lectus
Messages: 329
Registered: September 2006
Location: Brazil
Senior Member
Or you can try a workaround and just set up a dropbox account or google drive on both, the real and the virtual machine and copy your files freely between them.
Re: Compile for Unix on Windows?!?!?!? [message #38374 is a reply to message #38361] Wed, 12 December 2012 22:27 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Lectus:
I don't think a dropbox is the answer.
I can click on Win, copy files or directories, and then paste them into the Ubuntu VM.

I need to access the files directly.
On the regular Ubuntu install it is just under host.

I will try installing the "VMWare Tools" again.

Even under options I enabled shared for C:

Another glitch is I cannot link up to an SD card.
I safely remove the USB and the SD card from Win.
Then when the VM is active I plug the USB in and the VM sees it.
That does not work for the SD card.
Previous Topic: sessions in Skylark
Next Topic: Is it possible to design DockWindows with .lay files?
Goto Forum:
  


Current Time: Fri Apr 19 10:16:26 CEST 2024

Total time taken to generate the page: 0.03590 seconds