Author Topic: How to transfer projects between platforms automatically with C::B+wxWidgets  (Read 7622 times)

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
I found it is very complicated to transfer projects between platforms.
I list the steps below how I transfer a "Hello World" wxWidgets project from Linux to Windows XP
1. Project->Properties->libraries tab; select Cross-Platform |_wx:wxWidgets; click < button; uncheck Don't setup automatically check box
2. Project->Build options->Complier setting->Other options tab; add following
[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]

3.Project->Build options->Complier setting->#Defines tab; add following

Is there a easier way?
« Last Edit: June 16, 2008, 06:02:10 am by 00061205 »

Offline Deschamps

  • Multiple posting newcomer
  • *
  • Posts: 120
Is there a easier way?

How about defining a build target for each platform?
So, you only need to select the proper target when compiling your sources.


PS/ It's exactly the same way when you want to compile against different wxWidgets builds (unicode/ansi, static/shared, ...)
Those who were seen dancing were thought to be insane by those who could not hear the music

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
Thanks,I'll try. :D

Offline eranif

  • Regular
  • ***
  • Posts: 256
The problem is that you adding pre-processors manually rather than using the very much convenient wx-config tool.

instead of adding all the macros/switches, you can simply do this:

//to compile a simple hello world app on linux
g++ -c main.cpp -o HelloWorld `wx-config --libs --cflags`

The same can be used within CB, instead of hard coding all the macors/flags, replace it with:
`wx-config --cflags`

and in the linker:
`wx-config --libs`

Using the above method will work both on windows & linux & mac (you can get wx-config for windows from here:

This is how I do it (different IDE same principle)