Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Compile C++ project for both Ubuntu and Windows. (Is there a way to set Eclipse to compile C++ project for both Ubuntu and Windows?)
Compile C++ project for both Ubuntu and Windows. [message #1717111] Thu, 10 December 2015 00:58 Go to next message
Erick sriro is currently offline Erick sriroFriend
Messages: 12
Registered: December 2015
Junior Member
Hi,

Is there any way to set Eclipse to compile C++ project and get executable file, which can be used for both Ubuntu and Windows?

My Eclipse is installed in Ubuntu Studio 14.04?

Thanks.
Re: Compile C++ project for both Ubuntu and Windows. [message #1717120 is a reply to message #1717111] Thu, 10 December 2015 06:44 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The short answer is: no. The long answer is Heck, no!

To start, the executables are different formats (PE, PE32+ for Windows; ELF for Linux). Besides the overall OS interface is different as well.

You could make a Windows .exe and try executing it with WINE under Linux or perhaps in a Virtual Machine (like Virtual Box) running Windows also under Linux.

I'd try the WINE path first. I use it to run some XP programs that I can't get the source for. One of these programs won't run under Vista or W7. I haven't tried Virtual Box (or any other VM) yet. Looks like too much trouble for one but I'm probably going to try it soon before my last machine running iTunes dies.

Re: Compile C++ project for both Ubuntu and Windows. [message #1717206 is a reply to message #1717120] Thu, 10 December 2015 18:06 Go to previous messageGo to next message
Erick sriro is currently offline Erick sriroFriend
Messages: 12
Registered: December 2015
Junior Member
David Vavra wrote on Thu, 10 December 2015 06:44
The short answer is: no. The long answer is Heck, no!

To start, the executables are different formats (PE, PE32+ for Windows; ELF for Linux). Besides the overall OS interface is different as well.

You could make a Windows .exe and try executing it with WINE under Linux or perhaps in a Virtual Machine (like Virtual Box) running Windows also under Linux.

I'd try the WINE path first. I use it to run some XP programs that I can't get the source for. One of these programs won't run under Vista or W7. I haven't tried Virtual Box (or any other VM) yet. Looks like too much trouble for one but I'm probably going to try it soon before my last machine running iTunes dies.



Thank you so much. Here is one last question, though.
How do I get exe file from Eclipse, which installed in Ubuntu?

Re: Compile C++ project for both Ubuntu and Windows. [message #1717212 is a reply to message #1717206] Thu, 10 December 2015 19:12 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Never done it myself.
Google turned up this though
http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/
Must be more.
Re: Compile C++ project for both Ubuntu and Windows. [message #1717221 is a reply to message #1717212] Thu, 10 December 2015 19:54 Go to previous message
Erick sriro is currently offline Erick sriroFriend
Messages: 12
Registered: December 2015
Junior Member
Thank you so much.
Previous Topic:How do I run custom Codan static checker on selected files
Next Topic:How to select Visual Studio version to use for MSVC toolchain
Goto Forum:
  


Current Time: Thu Apr 25 23:40:55 GMT 2024

Powered by FUDForum. Page generated in 0.03597 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top