User forums => Using Code::Blocks => Topic started by: dje on August 31, 2007, 05:14:00 pm

Title: OS care in build process
Post by: dje on August 31, 2007, 05:14:00 pm
Hi all !

Fed up with synchronising 2 sandboxes on 2 PCs, I split my XP disk into 3 partitions :
- ext3 Ubuntu 7.04
- fat32

I put my sandbox and plugin project on the fat32 partition to share it between XP and Ubuntu and avoid plugin file transfers/sandbox synchro.
I built all on Ubuntu => OK

When I try to build on XP, I have this error message:
Code: [Select]
Linking console executable: build_tools\autorevision\autorevision.exe
.objs\build_tools\autorevision\autorevision.o: In function `Z11WriteOutputRKSsRSsS1_':
autorevision.cpp:(.text+0x3a): undefined reference to `ZNSsC1Ev'

As I never built C::B at this place on XP, I was surprised not to compile anything.
Then I realised that both projects build everything at the same location... Am I wrong ?

If not, I'd like the build process to take into account the OS (through a variable ?) to be able to use the same sandbox from diferent OSs.
If nobody disagrees, I'll create a feature request.

Title: Re: OS care in build process
Post by: thomas on September 01, 2007, 01:25:00 pm
I deem it a bad idea to build the same code base from two operating systems. This means you have to do a full rebuild (including deleting the precompiled headers) every time, instead of incremental builds.
Failure to do so will most likely break your build, or may cause the application to crash in an irreproducible manner.
Title: Re: OS care in build process
Post by: dje on September 01, 2007, 04:20:42 pm
Hi Thomas,

the main idea was to have on one side, the sources shared buy all OSs and on the other side, output files (intermediate + useful binaries) in different directories that depends on OSs, for example
win/.obj or ubuntu/.objs

win, ubuntu and others could be set by a variable.

Title: Re: OS care in build process
Post by: JGM on September 01, 2007, 05:08:26 pm
win/.obj or ubuntu/.objs

What I do is, if i have to projects one for linux and one for windows, I modify the project properties for each and make that changes that you are pointing.

For example:

Code: [Select]
Project for windows:
 - Object outputs dir: .obj/windows/release[ or debug]
 - Output filename: bin/windows/release[ or debug]/file.exe

Project for linux:
 - Object outputs dir: .obj/linux
 - Output filename: bin/linux/release[ or debug]/file

It work fine for me, just change that properties for each project and build target.