Author Topic: Best method for x-platform compiling with wxWidgets  (Read 5364 times)

Offline Jorg

  • Multiple posting newcomer
  • *
  • Posts: 32
Best method for x-platform compiling with wxWidgets
« on: November 21, 2005, 04:50:22 pm »
Hi guys,

I had some time and played with Code::Blocks. I am very impressed by the ease of how I can configure my projects and fairly quickly where able to compile my code (read compile: not linking yet ;-) ) .. I am excited about the editor as it has many features a mature IDE has, which ofcourse speeds up my development.

I was wondering what the best way is to create a project that can be used on both linux and windows. Is this a realistig thought? Let me explain what I want to do:

On linux I compile and install wxWidgets ofcourse like usual, make, make install, ldconfig, the works. I could suffice I guess by adding `wx-config --cppflags` as option for compiling and `wx-config --libs` for linking. This would go as painless as that and stay compatible with my current installed distrib.

Under windows this is much more problematic, as I have to have GCC compatible libraries to link to for debug information. I thought I could use MSYS to build wxWidgets, and simply point to that directory. However then I miss the flags that wx-config would produce.

My question is, is there a x-platform way to use wxWidgets and not change the project settings ? Or is there a windows / linux section in the build options in which one could maybe seperate different kind of flags?

I have read about the devpak but after configuring the plugin I only saw wx2.2.9 as devpak which is ofcourse terribly outdated. I have to admit I have not looked into the devpak further then that.

Any ideas are welcome. I post this under the Windows topic as it is a windows only problem now, as i consider linux my main build env. and I want to keep my projects as portable as possible. If I can use the Makefile output of C::B also under Windows (using minGW) then I guess that would also be an option.

Regards,
- Jorgen

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Best method for x-platform compiling with wxWidgets
« Reply #1 on: November 21, 2005, 05:07:19 pm »
Jorgen: We have a tutorial in the wiki about compiling wxwidgets. We use that to compile codeblocks, but it could as well be used (with some minor changes of course) to make a wxwidgets library for your project.

I've compiled wxWidgets myself on windows (WITHOUT msys) and copied the dll's to windows' directory. I also make sure to compile again with SHARED=0 for the case when I need a statically linked wxwidgets.

In the wiki, i have detailed what extra files you need to compile wxwidgets successfully.

takeshimiya

  • Guest
Re: Best method for x-platform compiling with wxWidgets
« Reply #2 on: November 21, 2005, 05:24:07 pm »
rickg22: I think Jorg is talking about a project file to be used on both windows and linux.

It is not possible for the moment, you have to create two different project files like Project-MSW.cbp and Project-UNIX.cbp.
Having multiple settings for different OS will be possible after the compiler plugin revamping (in the next major version) of Code::Blocks.

Another option would be to use a bakefile. ABX is introducing Code::Blocks project files output to bakefiles. I'm not sure if he finished it yet.

About compiling wxWidgets, the most easy way is to compile (read the WiKi) using MinGW (without MSYS).
« Last Edit: November 21, 2005, 05:31:38 pm by Takeshi Miya »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Best method for x-platform compiling with wxWidgets
« Reply #3 on: November 21, 2005, 06:31:43 pm »
I suggest you read about global compiler variables :)
Be patient!
This bug will be fixed soon...

Offline Jorg

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Best method for x-platform compiling with wxWidgets
« Reply #4 on: November 21, 2005, 06:41:43 pm »
Thanks guys! I will have a look see in the Wiki. I will wait patiently for the new revamping, do you have any idea when that is finished?

I know that ABX was looking at Bakefile for Code::Blocks that would be very nice, because compiling wxWidgets in Code::Blocks will ofcourse ease the development cycle and perhaps eliminate the problem under linux where the make install with a debug build will have to be redone when the build is in release mode. It is much easier if I can simply switch in Code::Blocks to what version I would require.

Keep up the good work guys, this looks like a promising IDE and I will use it in the future and give my feedback if needed.

Thanks,
- Jorgen

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Best method for x-platform compiling with wxWidgets
« Reply #5 on: November 21, 2005, 06:46:26 pm »
The current revamping will be finished hopefully in 2 or 3 weeks, the latest change in the configuration routines set a few bugs free, so we're busy finding and squashing them :P overall it's fun.

The MAJOR compiler revamping (which will allow for various compilers / OS / etc) will take place after version 1.0 is released.