Files
wxWidgets/docs/tech/tn0004.txt
2000-04-13 09:31:19 +00:00

115 lines
3.1 KiB
Plaintext

Date: Tue, 11 Apr 2000 20:25:20 +0100 (BST)
From: Chris Elliott <cje2@biolpc22.york.ac.uk>
To: wxDevelopers <wx-devel@wxwindows.org>
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 <condefs.h>
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