Author Topic: move project from linux <--> windows  (Read 7292 times)

Offline bugmenot

  • Multiple posting newcomer
  • *
  • Posts: 32
move project from linux <--> windows
« on: March 27, 2008, 02:46:10 am »
codeblocks v8.02

I have a linux wxwidgets project. So I just tried moving it (copied entire project folder) to a windows box. The project opens fine, but it wouldn't compile. Seems to be missing locations for wx include & lib files. And maybe needs to know different lib files for windows..? But before I start manually fixing it my own way, I was wondering is this wise?

Should I just maintain two different project files, one for linux and one for windows?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: move project from linux <--> windows
« Reply #1 on: March 27, 2008, 08:37:37 am »
yes, the main difference is where the wx stuff is.

On linux you can see in the cbp file it uses backticks on wxconfig. On windows you can use the CB global variable.

Just create a wx project in CB on windows (with the wizards), and then have a compare on the cbp files, and it will become obvious which compiler/linker settings you will need to copy into the 'cbp that came from linux)

@biplab : This is something I have been thinking about for a long time. What about a wx project wizard for multiple platforms, giving you 4 targets :
1) Debug(linux)
2) Release(linux)
these 2 only for platform::linux
3) Debug(windows)
4) Release(windows)
these 2 only for platform::windows

Would be very cool, I myself am always manually copy/pasting cbp's to have the same project file for win and linux ...

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: move project from linux <--> windows
« Reply #2 on: March 27, 2008, 03:16:40 pm »
@biplab : This is something I have been thinking about for a long time. What about a wx project wizard for multiple platforms, giving you 4 targets :
1) Debug(linux)
2) Release(linux)
these 2 only for platform::linux
3) Debug(windows)
4) Release(windows)
these 2 only for platform::windows

Would be very cool, I myself am always manually copy/pasting cbp's to have the same project file for win and linux ...

A wizard to make portable projects would be very cool. If done it is needed to support different compilers on different platforms. I have done this for almost a year already, it almost works fine, I use 4 build targets

Debug_W32/Release_W32  : Windows XP with MS Visual Studio 2005 Express C++ compiler
Debug_UX/Release_UX      : Linux Kubuntu 7.04/7.10 with GCC

The .cbp file was edited in a text editor to contain the 4 build targets. References to wxWidgets and other libraries in the build options always use C::B global variables which are different on different platforms. That way the .cbp file is independent on where libraries used are installed.

This works fine except that
a) You cannot compile individual files explicitely. You must always "build" the project.
b) Multiple warning dialogs about non-existing MSVC8 compiler is given for the Windows build targets when opening the project on Linux, even though the Windows build target is specified to be Windows only.

Given these limitations, it works ok. The .cbp, wxSmith and C++ files can be copied back and forth without problems. Komparator on Kubuntu is a great tool for such copying.

So a wizard to support this scenario would be most welcome.  :lol:

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: move project from linux <--> windows
« Reply #3 on: March 27, 2008, 04:33:53 pm »
@biplab : This is something I have been thinking about for a long time. What about a wx project wizard for multiple platforms, giving you 4 targets :
1) Debug(linux)
2) Release(linux)
these 2 only for platform::linux
3) Debug(windows)
4) Release(windows)
these 2 only for platform::windows

Would be very cool, I myself am always manually copy/pasting cbp's to have the same project file for win and linux ...

That would be a nice extension to the wizard. I'll try to work on it this weekend. :)

This works fine except that
a) You cannot compile individual files explicitely. You must always "build" the project.
b) Multiple warning dialogs about non-existing MSVC8 compiler is given for the Windows build targets when opening the project on Linux, even though the Windows build target is specified to be Windows only.

Bugs!! Please file them at Berlios. :)
Be a part of the solution, not a part of the problem.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: move project from linux <--> windows
« Reply #4 on: May 26, 2008, 11:11:24 pm »
@Biplab : just a little reminder  8)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: move project from linux <--> windows
« Reply #5 on: May 27, 2008, 06:23:16 am »
@Biplab : just a little reminder  8)

Thanks for reminding me. I almost forgot this. ;)
Be a part of the solution, not a part of the problem.

Offline Alexis

  • Multiple posting newcomer
  • *
  • Posts: 62
move project from linux <--> windows : for MacOSX
« Reply #6 on: May 27, 2008, 10:34:00 am »
And generating a project file for C::B under MacOSX would be great as well...

Offline LeRoi

  • Single posting newcomer
  • *
  • Posts: 4
Re: move project from linux <--> windows
« Reply #7 on: May 27, 2008, 11:55:03 am »
I thought this is already possible !

Using multiple build targets on codeblocks is well supported , not ?
and you don't have to use a text editor, just add a new build target, configure it correctly, and you can use the same cbp file on multiple platforms .

Please correct me if I'm wrong .

Offline Alexis

  • Multiple posting newcomer
  • *
  • Posts: 62
Project linux / windows - wxWidgets's project wizard improvement
« Reply #8 on: May 27, 2008, 02:48:48 pm »
Quote
I thought this is already possible !

Using multiple build targets on codeblocks is well supported , not ?
and you don't have to use a text editor, just add a new build target, configure it correctly, and you can use the same cbp file on multiple platforms .

Please correct me if I'm wrong .

Look at wxWidgets's project wizard. When you are in the step "Select the compiler" (i. e. target?), it would be nice to be able to select also an OS (typically : Windows, Linux, MacOSX, WinCE). The best thing would to be able to create several targets at a same time. A target would be a combination of compiler and OS. Probably quite hard to implement, but would be very useful. In a first time, only most common combinations could be implemented.

To eventually make this wizard a killer-app, in the step "GUI Builder", the two following "Application types" could be added:
  • MDI
  • wxAUI MDI

And finally, supporting the doc/view architecture (add a checkbox in this step) would be enjoyable! I have already posted a request for this.

I haven't the time to do it right now, but in the next months, maybe, if nobody has done it before...

Offline Deschamps

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: move project from linux <--> windows
« Reply #9 on: May 28, 2008, 10:33:10 am »
Hello,

I'm not sure about having understood correctly this thread, but (as LeRoi has said) I think that, having in mind the great range of configurations all of us are using, the most simple way is definig "user templates". In fact, I'm using some self-defined templates containing multiple platform targets with multiple configurations, and I'm using all of them without problems (I only needed to copy this template to my user folder in each system).

Doing that, I can work satisfactorily with the same source (the same physical folder, obviously saved in a shared partition) from any system installed in my box.

Regards.
Those who were seen dancing were thought to be insane by those who could not hear the music