Skip to content

Instantly share code, notes, and snippets.

@rofl0r
Last active February 3, 2023 07:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rofl0r/bf2bbd6941e1fd75afb6308cc5af0d9c to your computer and use it in GitHub Desktop.
Save rofl0r/bf2bbd6941e1fd75afb6308cc5af0d9c to your computer and use it in GitHub Desktop.

How to get Borland C++ Builder 6 working in wine

unlike Borland RAD Studio 2009 C++ Builder 6 installs without issues in wine (tested: 6.22).

while at it, install also service pack 4 (contains sp1-3 too): http://altd.codegear.com/devsupport/cbuilder/cb6/bcb6_eng_ent_upd4.exe sha256sum 49d72403d29922633c65457e160e6a029f4a26eaa61a486942b4a419f9a73e4b

and linker update: http://altd.codegear.com/devsupport/cbuilderx/C++B6_and_C++BX_linker_patch/ilink_ent.zip sha256sum 0227eb5ce1eebd86aa05c618d8d52678cfd7e3e0697c52df4d74b625046a278d

However, linking fails with the dreaded fatal linker errors LME 280, 288, etc.

This stack overflow question has the solution to get it working.

basically, one needs to patch ilink32.exe with masm32's editbin.exe to make it large address aware. that makes ilink32.exe work when used standalone from the command line. however, when invoked from the IDE, it still fails. i was able to get it working by patching bcc32.exe and bcb.exe too.

wine masm32/bin/editbin.exe /LARGEADDRESSAWARE C:\\Program\ Files\\Borland\\CBuilder6\\Bin\\ilink32.exe
wine masm32/bin/editbin.exe /LARGEADDRESSAWARE C:\\Program\ Files\\Borland\\CBuilder6\\Bin\\bcc32.exe
wine masm32/bin/editbin.exe /LARGEADDRESSAWARE C:\\Program\ Files\\Borland\\CBuilder6\\Bin\\bcb.exe

the patch just changes a couple bytes in the PE header. namely in case of ilink32.exe: offset 0x216: change 0e to 2e offset 0x258: change 000000 to 02a305

i attach here the 3 patched exes for your convenience, as installing masm32 only for this purpose is a bit of a pain. as they're freely available and contained in the above mentioned update urls, i see no issue distributing them here too.

@rofl0r
Copy link
Author

rofl0r commented Nov 25, 2021

bcb6bins_patched.tar.gz.mp4

rename to tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment