diff --git a/docs/tech/index.txt b/docs/tech/index.txt index 12ddc25678..83d181e2c4 100644 --- a/docs/tech/index.txt +++ b/docs/tech/index.txt @@ -1,5 +1,6 @@ TN0001 How to add a new sample TN0002 wxWindows translator guide TN0003 Adding wxWindows class documentation +TN0004 Compiling a sample in the C++Builder 1.0 IDE Version: $Id$ diff --git a/docs/tech/tn0004.txt b/docs/tech/tn0004.txt new file mode 100644 index 0000000000..e3369b2539 --- /dev/null +++ b/docs/tech/tn0004.txt @@ -0,0 +1,114 @@ +Date: Tue, 11 Apr 2000 20:25:20 +0100 (BST) +From: Chris Elliott +To: wxDevelopers +Subject: [wx-dev] [wxdev] wxWin BCB compile in IDE 2.1.15 + +I have compiled the MDI sample in the Borland C++Builder 1.0 IDE. + +To do this you need to add a bit to the top of the mdi.cpp file like this + +#if defined(__BORLANDC__) +#include +USERC("mdi.rc"); +#endif // defined(__BORLANDC__) + +though it might be better to define another variable + +The .mak file looks like this; + +#----------------------------------------------------------------------------- +VERSION = BCB.01 +#----------------------------------------------------------------------------- +!ifndef BCB +BCB = $(MAKEDIR)\.. +!endif +PROJECT = mdi.exe +OBJFILES = mdi.obj +RESFILES = mdi.res +RESDEPEN = $(RESFILES) +LIBFILES = + +#----------------------------------------------------------------------------- +CFLAG1 = -O2 -w- -k -r -v -vi -c -WM -R +CFLAG2 = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32 \ + +-Id:\wx\samples\include\wx\msw;$(BCB)\include;$(BCB)\include\vcl;d:\wx\include;.\MDI +\ + -H=BC32.CSM -n.\MDI +PFLAGS = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32 \ + +-Ud:\wx\samples\include\wx\msw;.\mdi;$(BCB)\lib;$(BCB)\lib\obj;d:\wx\lib \ + +-Id:\wx\samples\include\wx\msw;$(BCB)\include;$(BCB)\include\vcl;d:\wx\include;.\MDI +\ + -v -jph -m +RFLAGS = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32 \ + +-id:\wx\samples\include\wx\msw;$(BCB)\include;$(BCB)\include\vcl;d:\wx\include;.\MDI +\ + -I$(BCB)\include;$(BCB)\include\vcl;;.\MDI +LFLAGS = +-Ld:\wx\samples\include\wx\msw;.\mdi;$(BCB)\lib;$(BCB)\lib\obj;d:\wx\lib \ + -aa -Tpe -v -V4.0 -c +IFLAGS = +LINKER = ilink32 +#----------------------------------------------------------------------------- +ALLOBJ = c0w32.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) vcl.lib xpm.lib wx32.lib ole2w32.lib import32.lib \ + cp32mt.lib +# +--------------------------------------------------------------------------- +.autodepend + +$(PROJECT): $(OBJFILES) $(RESDEPEN) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB),, + + $(ALLRES) +! + +.pas.hpp: + $(BCB)\BIN\dcc32 $(PFLAGS) { $** } + +.pas.obj: + $(BCB)\BIN\dcc32 $(PFLAGS) { $** } + +.cpp.obj: + $(BCB)\BIN\bcc32 $(CFLAG1) $(CFLAG2) -o$* $* + +.c.obj: + $(BCB)\BIN\bcc32 $(CFLAG1) $(CFLAG2) -o$* $** + +.rc.res: + $(BCB)\BIN\brcc32 $(RFLAGS) $< +#----------------------------------------------------------------------------- + + +I can't persuade it to accept $(WXDIR) in place of d:\wx for some reason. +Parts of the file are automatically regenerated by the BCB system, so it +always adds unncessary vcl libaraies !! + +The USERC macro is used by the ide to automatically manage the RC file and +in a VCL poject would be used to control the several units. In case you +are wondering, the relevant macro is expanded in condefs.h + +#define USERC(FileName) \ + extern DummyThatIsNeverReferenced + +If you have more thann one cpp unit, you can use a part of the code like +this + +#define USEUNIT(ModName) \ + extern DummyThatIsNeverReferenced +#define USERES(ModName) \ + extern DummyThatIsNeverReferenced + +USEUNIT("child.cpp"); +USERES("mdi.RES"); + + +chris + diff --git a/src/makeprog.b32 b/src/makeprog.b32 index 11e1f6cbcc..06e61fd4db 100644 --- a/src/makeprog.b32 +++ b/src/makeprog.b32 @@ -30,7 +30,7 @@ OPT = -Od DEBUG_FLAGS = !endif -CPPFLAGS=$(CPP_FLAGS) $(DEBUG_FLAGS) $(OPT) +CPPFLAGS=$(CPP_FLAGS) $(DEBUG_FLAGS) $(OPT) @$(CFG) all: $(TARGET).exe $(EXTRATARGETS)