Dual Target Builds (Linux and Windows)

General questions regarding the usage of CodeLite
Tom
CodeLite Curious
Posts: 6
Joined: Sat May 18, 2013 12:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Dual Target Builds (Linux and Windows)

Post by Tom »

I am in the planning stages of a project that I would like to run on Linux (my primary usage) and Windows (most of the other users).
I have to say that Mac users would be a bonus.

Using CodeLite w/wxWidgets (I guess the wxCrafter plugin) can I build for all three targets from one build system?

Or will I need to have an install on each target system and build it natively?

I am running Debian (Wheezy) and installed from the apt repositories

Also I am primarlly a C programmer, will I lose any functionality or serious Ease Of Use features by running C instead of C++?

Thanks,
Tom
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by eranif »

Tom wrote:can I build for all three targets from one build system?
No. wxWidgets is "code once build everywhere"
You need to compile it for each target
Tom wrote:Also I am primarlly a C programmer, will I lose any functionality or serious Ease Of Use features by running C instead of C++?
I am not sure what you are asking here. But IMO, anything that can be done in C can be written in C++

Eran
Make sure you have read the HOW TO POST thread
Tom
CodeLite Curious
Posts: 6
Joined: Sat May 18, 2013 12:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by Tom »

eranif wrote:
Tom wrote:Also I am primarlly a C programmer, will I lose any functionality or serious Ease Of Use features by running C instead of C++?
I am not sure what you are asking here. But IMO, anything that can be done in C can be written in C++
Eran
I since have discovered that wxWidgets does not have bindings for C, just C++ so my question becomes meaningless :)

But I am trying to do the Hello World example and it seems to be for a different version of the designer than is pictured http://codelite.org/LiteEditor/WxCrafterHelloWorld

Is the Debian apt repos version older than the 'latest'?

Are there any other tutorials that may help me learn how to use the desginer?

Call me skeptic, but I want to prove to myself that it works like it is described (code once build everywhere) I will be happy to $upport this project :)

Tom
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by eranif »

Tom wrote:But I am trying to do the Hello World example and it seems to be for a different version of the designer
Can you post a screenshot? note that the above screenshot was taken from Windows and using wxCrafter 1.0 ( you should be using v1.1 which is a newer version)

But again, a screenshot will help clarify your question

Eran
Make sure you have read the HOW TO POST thread
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by DavidGH »

Hi,
Using CodeLite w/wxWidgets (I guess the wxCrafter plugin) can I build for all three targets from one build system?
As Eran said, you can't do a single build of C/C++ code that will work anywhere. However, as the conversation then moved to wxCrafter, let me add that wxCrafter optionally can output XRC instead of C++, and XRC is inherently multiplatform.

Of course you still need to write the non-gui bit of your program in C++, so that's not a complete solution for you. But there isn't a complete solution available using C/C++. Even just considering Linux, you'll still need to create separate builds for the different distros (and for different versions of each target distro), not to mention 32 and 64 bit ones. I find VirtualBox very useful for this.

Regards,

David
Tom
CodeLite Curious
Posts: 6
Joined: Sat May 18, 2013 12:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by Tom »

DavidGH wrote:Hi,
As Eran said, you can't do a single build of C/C++ code that will work anywhere. However, as the conversation then moved to wxCrafter, let me add that wxCrafter optionally can output XRC instead of C++, and XRC is inherently multiplatform.

Of course you still need to write the non-gui bit of your program in C++, so that's not a complete solution for you. But there isn't a complete solution available using C/C++. Even just considering Linux, you'll still need to create separate builds for the different distros (and for different versions of each target distro), not to mention 32 and 64 bit ones. I find VirtualBox very useful for this.
So it sounds like if I am using CodeLite w/wxCrafter then I will be able to build an executable for each type of system I can get my hands on that is supported by CodeLite.
Well also that platform needs a wxWdigets port as well...

VirtualBox, I've seen that before but I've never had a big enough need to try it, this may be the ticket.

tom
Tom
CodeLite Curious
Posts: 6
Joined: Sat May 18, 2013 12:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by Tom »

eranif wrote: Can you post a screenshot? note that the above screenshot was taken from Windows and using wxCrafter 1.0 ( you should be using v1.1 which is a newer version)

But again, a screenshot will help clarify your question

Eran
Ok the tutorial is here http://codelite.org/LiteEditor/WxCrafterHelloWorld

The first thing that slowed me down is that wxCrafter did not appear in the Workspace Tabs
CodeLite_WSV.png
then I went Plugins->wxCrafter->Open abd found the wxcp file, or found (expanded groups) and opened the wxcp file

ok so far so good.

I just discovered my next error, I think I picked wxWidgets+wxCrafter instead of wxDialog based + wxCrafter

I will re-do my test following the instructions better! (I think that is why things weren't matching up for me!)

tom
You do not have the required permissions to view the files attached to this post.
Tom
CodeLite Curious
Posts: 6
Joined: Sat May 18, 2013 12:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by Tom »

Well I think I found why the Tab was missing...

Maybe you need a better default for this: (ie Have it checked like this:)
BetterDefault.png
that now I have a build problem... sounds like an installlation problem...
You do not have the required permissions to view the files attached to this post.
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Dual Target Builds (Linux and Windows)

Post by Gibbon1 »

Not sure if this help or is 'worth it' but this one time I need to build OpenOCD for windows and I managed it by building a GCC Cross Compiler to target Windows, then using that under Linux to build OpenOCD for Windows. And it basically just worked. (What a man will go through to avoid Cygwin)

That said where I work we use VirtualBox all the time for exactly this reason. If the program or build system works better with Linux or Windows, we use VirtualBox to provide the OS it wants. Pretty much we use Windows native an Linux under Virtual Box. My boss uses VirtualBox and WinXP on his mac, works fine.

Also at the risk if invoking wrath. Depending on what you're doing you could also try Mono (Open Sourced C#) with Windows Forms. As a primary embedded C + hardware guy I found the C# wall easier to climb than C++. Word of caution it's common with C#/.net to link to native dll's, if you're cross platform you need to cross compile those too and make sure they work correctly.
Post Reply