BuilderX

From WxWiki

Jump to: navigation, search

[edit] Using wxWidgets with the Borland C++ BuilderX

These instructions describe how to use wxWidgets with the Borland C++ BuilderX on Microsoft Windows. The instructions were tested with:

  • wxWidgets 2.6.3
  • Borland C++ BuilderX Version 1.0 (Build 1786)
  • Microsoft Windows XP Professional version 2002 with Service Pack 2

I've downloaded both linux and windows version of CBX from Borland around 2004/2005. The whole installation packet for Linux, Solaris and Windows is ca. 410 Mb huge. Unfortunately, Borland C++ BuilderX is no longer available for download, so look for old computer magazines or ask your friends.

To start you should install both Borland BuilderX and wxWidget. Do not use paths with spaces in it (like "Program Files"). I've installed mine as "C:\CBuilderX" and "C:\BuilderX\WX" respectively. If you want to use different path you have to adjust all the paths in example below. The installation procedure is the same as for its big brother C++ Builder so read it there  :)

[edit] Creating Your wxWidgets Application

  1. Create a directory where you want to store your projects (default is something like "C:\Documents and Settings\USER_NAME\cbproject\").
  2. Copy all necessary source files to this directory. As example I use minimal from \WX\samples\minimal and the needed files are: minimal.cpp and minimal.rc.
  3. Start Borland C++BuilderX (from now BCX) and select New project icon.
  4. BCX shows you object gallery – select "New GUI Application".
  5. This starts a Project Wizard. Give your project a name (i.e. minimal) and select the directory where you've saved previously all needed files.
  6. In the 2nd step, the wizard ask you about platforms – I usually select both Windows and Linux.
  7. In the 3rd step, press "Add...", and add all minimal.* files.
  8. After pressing [OK], add you will need to add the wxWidgets libraries from the WX/lib/bcc_lib directory. Add wxbase26d.lib, wxmsw26d_core.lib, and any others you are going to need.
  9. After pressing "Finish", select Project->Build Options Explorer from the menu. You will see a dialog with all paths, and options for the compiler and linker.
  10. Select from Tools ILINK32 and in Paths add:
    • $(BCBX)\lib
    • $(BCBX)\lib\psdk
    • $(BCBX)\WX\lib\bcc_lib
    • $(BCBX)\Wx\lib\bcc_lib\mswd
  11. Go to [Options]-card and select -aa for 32-bit windoof application and select [Export settings...]-button.
  12. In the "Export current build tools settings" form, press "Select All" and after naming it, save the settings by pressing "OK".
  13. Then select from Tools BCC32 and set Include search path -I to:
    • $(BCBX)\include
    • $(BCBX)\Wx\lib\bcc_lib\mswd
    • $(BCBX)\Wx\include
    • $(BCBX)\Wx\include\wx\mswd
  14. Then in the Conditional defines -D, you'll need:
    • _DEBUG
    • __WXMSW__
    • __WXDEBUG__
  15. Export these settings as you did for ILINK
  16. For resources compiler BRCC32 set include search path -I as for BCC32 and again export the settings.
  17. You can see exported settings in Tools/Exported Settings Groups...
  18. I've changed content of minimal.rc to:
mondrian ICON "c:\CBuilderX\WX\samples\sample.ico"
#include "C:\CBuilderX\WX\include\wx\msw\wx.rc"

Now you can compile – hit F9. I've tested it with more examples from wxWidgets distribution and it has always worked. Be carefull and copy ALL needed files. Last remark – in this instruction I always used "Documents and Settings" directory. It's good bad example :). As I've written on the beginning you should avoid names with spaces (actually I write all my files on linux server that via smb-mount is linked to drive Z:\).

[edit] How to Import All Compilation Settings to the New Project

  1. Start new project like the first 8 steps.
  2. Select Wizards/Target setting... menu.
  3. In wizard select Multi-thread Windows project...
  4. ...and in the 2nd step, select all previously exported wx-settings.

Actually one could add in Project/Build Options Explorer/ILINK32/Options/Library files... some wxWidgets-dlls and spare some time, but this way is more flexible as not always one need the same libraries.

Have fun :)

How to use BuilderX for linux has to be tested.

Personal tools