diff --git a/docs/tech/index.txt b/docs/tech/index.txt index 6986dcc7d3..35cbcd4481 100644 --- a/docs/tech/index.txt +++ b/docs/tech/index.txt @@ -1,7 +1,7 @@ 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 +TN0004 Compiling a sample in the C++Builder IDE TN0005 Adding a wxWindows contribution TN0006 Making and installing RPMs for wxWindows TN0007 Using and modifying the BC++ IDE files diff --git a/docs/tech/tn0004.htm b/docs/tech/tn0004.htm new file mode 100644 index 0000000000..acf43fcaef --- /dev/null +++ b/docs/tech/tn0004.htm @@ -0,0 +1,218 @@ + + + + + + + Compiling wx Samples in the Borland IDE + + + +

+Compiling wxWindows samples with the Borland CBuilder

+ +This document is available online here.

+ +

+Before you begin

+This refers to the 2.1.15 wxWindows distribution. It is my account of trying +to compile the samples so I can use the Borland IDE to edit/compile/debug. +I have used CBuilder 1.00 (2 patches, nice and fast) CBuilder 3 (slower) +and CBuilder 4 (only occasionally) +

Make sure that the wx distribution is extracted to a path with no spaces +in it, and preferably on the root of your drive. Borland's compilers sometimes +have problems with spaces and with the long paths which occur if you try +to place it in a tree like d:\compiler\gui\wx... +

+Part 1 Build the library

+Build the wx\wx32.lib and related files using the command line compiler +
Run a command prompt in the wx/src/msw directory and type +

set wxwin=pathtowx +
set bccdir=pathtobc4 +
make -f makefile.b32 +

In my case this I extracted the wx distribution in c:\ and the +compiler is in w:\borland\cb\bin so this looks: +

set wxwin=c:\wx +
set bccdir=w:\borland\cb +
make -f makefile.b32 +

If this doesn't compile, +

+If this doesn't link, + + +
+

+To make the samples

+ +

+Solution 1

+ +

+Download a zip file which contains modifed +cpp, mak and bpr files - it will overwrite your wx distribution cpp files!

+ +

+Solution 2

+Creating the files by hand . This is for the calendar sample; you will +have to change the names for the other samples + +#----------------------------------------------------------------------------- +
#this is for Borland CBuilder IDE v1 and 3 +
#add a \ at the end of the lines if you editor breaks the long +lines up +
#copy this into notepad and save from there +
#----------------------------------------------------------------------------- +
!ifndef BCB +
BCB = $(MAKEDIR)\.. +
!endif +
PROJECT = calendar.exe +
OBJFILES = +
RESFILES = calendar.res +
RESDEPEN = $(RESFILES) +
LIBFILES = +
#----------------------------------------------------------------------------- +
CFLAG1 = -Od -v -a1 -c +
# -Od disable optimisations -v debug -a1 byte align -c compile +only (matches my make for the library) +
CFLAG2 = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32;__BIDE__;-I$(BCB)\include;$(BCB)\include\vcl;..\..\include; +-H=BC32.CSM +
PFLAGS = +
RFLAGS = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32;__BIDE__; +-I$(BCB)\include;..\..\include; +
LFLAGS = -L$(BCB)\lib;$(BCB)\lib\obj;..\..\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 +odbc32.lib cw32mt.lib +
#you will need to add other libraries to the line above, eg the +jpeg.lib for image samples +
--------------------------------------------------------------------------- +
.autodepend +
  +

#----------------------------------------------------------------------------- +
$(PROJECT): $(OBJFILES) $(RESDEPEN) +

#end of file +
  +

+#ifdef __BIDE__ +
#define _NO_VCL +
#include "condefs.h" +
#define WinMain WinMain +
   // USEUNIT ("another.cpp"); // use a line like this +if you have more than one .cpp file +
    USERC ("calendar.rc"); +
#endif +
  +

In CBuilder 1 you can use Open Project to open the mak file and +edit/compile/debug. +
In CBuilder 3 and 4, then you can use Open Project and choose +the Open Borland CBuilder 1 Project from the drop down file types. The +system will modify the mak file and update it for you. +

Now try compiling it in the ide. +

+Hints:

+ + + +

+Solution 3

+ + +I found in CBuilder 1 that the idetomak utility did not manage +to convert all the samples, but idetobpr worked OK in CBuilder +3 and 4. I have a report that not all the bpr files made inb CBuilder 4 +are correct +

+Error with ODBC32

+Sometimes you get an error saying that there are unreolved externals in +ODBC. The soltuion is to run a command prompt in your wx\lib directory +and use the implib command: +

C:\wx\lib>implib odbc32 c:\windows\system\odbc32.dll +

This creates the necessary library, odbc32.lib +

+Unresolved Problem

+In Borland CBuilder 1.00 (with linker service patch)  I frequently +get an error +

Turbo Incremental Link  Version 1.0 Copyright (c) 1997 Borland +International +
Fatal: Assertion failed: typeInx < typeCnt at "ilinkdbg.c", +line 2060 +
Fatal: Access violation.  Program terminated. +
Error: Internal failure -- retrying link... +
Fatal: Assertion failed: typeInx < typeCnt at "ilinkdbg.c", +line 2060 +
Fatal: Access violation.  Program terminated. +

** error 2 ** deleting minimal.exe +

I have not been able to track down why sometimes this error occurs and +other times it is OK +
I have not seen this in Cbuilder 3 or 4 +

+


+

Page updated on 31 May 2000 by Chris Elliott + + diff --git a/docs/tech/tn0004.txt b/docs/tech/tn0004.txt deleted file mode 100644 index e3369b2539..0000000000 --- a/docs/tech/tn0004.txt +++ /dev/null @@ -1,114 +0,0 @@ -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 -