|
2001-04-05
| ||
| 06:54 | • Ticket [218319ffff] problem builing extensions with Borland C 5.2 status sti... artifact: c17b3f1e55 user: dgp | |
|
2000-10-26
| ||
| 08:19 | • Deleted ticket [218319ffff]. artifact: dcbe21c575 user: welch | |
| 00:56 | • New ticket [218319ffff]. artifact: 190db4389b user: nobody | |
problem builing extensions with Borland C 5.2
Deleted218319ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:56:07
OriginalBugID: 3813 Bug Version: 8.2.2 SubmitDate: '1999-12-08' LastModified: '1999-12-08' Severity: SER Status: Closed Submitter: techsupp ChangedBy: hobbs OS: Windows 95 OSVersion: Win95 (same code works fine under RH Linux 6.1 on the same PC) Machine: Cyrix P200+, Matrox mystique SVGA, 64MB RAM, TX chipset, SMC eth FixedDate: '2000-10-25' ClosedDate: '1999-12-08' Name: Simon Greaves CustomShell: just the above patch to tcl.h Comments: Other problems I've had related to the Borland compilers are: inport and static library file format incompatabilities: Borland provide a tool (implib) to derive import libs from DLL's which works, but static libraries are still a problem. I wanted to use the stubs interface and to do so I had to build it from source (which only required the above patch). Once I'd done this I was able to build the extension with stubs support too. The tcl symbols in the dll's do not have underscores added by the compiler whereas the Borland compiler does. This can be disabled, but Borland's C runtime _does_ have underscores on all the symbols. I worked around this by switching off the auto underscore feature and creating a define for each of the the RTL symbols I needed with an underscore prepended eg: #if defined (__WIN32__) && defined (__BORLANDC__) # define sprintf _sprintf #endif I have used other libraries which I believe were compiled with VC which did not cause this problem, would it be possible for you to produce dll's that work with either compiler without breaking VC support? I tried using gcc from Cygwin-b20 but this had other problems (issues with winsock etc). I am willing to provide more details on request. I may compile tcl/tk with BorlandC, if so I'd be happy to provide 'borland compatible' versions of the libraries. ReproducibleScript: I believe the documentation provided in: http://www.scriptics.com/services/support/howto/winext.html for compiling with Borland C compilers is incorrect, at least for reasonably recent versions of the compiler. I made a trivial change to tcl.h to enable the macros for Borland C. If you agree, I'm willing to help update the document. I've also had some problems with the tcl libraries and the Borland C compiler. DesiredBehavior: The Borland compilers I have (Borland C++ v5.2 and C++ Builder 3, BCC32 v 5.02 and 5.03) seem to support '__declspec(dllexport)' for building DLL's. I made a minor mod to the tcl.h include file so the DLLIMPORT and DLLEXPORT macros get defined as they do for VC. Patch: *** tcl.h.dist Wed Dec 8 10:32:46 1999 --- tcl.h Mon Dec 6 22:08:04 1999 *************** *** 220,226 **** # define DLLIMPORT # define DLLEXPORT #else ! # if defined(__WIN32__) && (defined(_MSC_VER) || (defined(__GNUC__) && defined(__declspec))) # define DLLIMPORT __declspec(dllimport) # define DLLEXPORT __declspec(dllexport) # else --- 220,226 ---- # define DLLIMPORT # define DLLEXPORT #else ! # if defined(__WIN32__) && (defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x500)|| (defined(__GNUC__) && defined(__declspec))) # define DLLIMPORT __declspec(dllimport) # define DLLEXPORT __declspec(dllexport) # else PatchFiles: tcl.h The items in the above mentioned URL should probably be removed. Stories of Borland's changing behavior have lead us to drop it in general from the supported compilers, although users can patch it again if necessary. Ideally it should work with the same makefile and sources as MSVC (and reportedly did in some version), but we see its fickleness in this response: From: David Cuthbert <[email protected]> [email protected] wrote: > DesiredBehavior: > The Borland compilers I have (Borland C++ v5.2 and C++ Builder 3, > BCC32 v 5.02 and 5.03) seem to support '__declspec(dllexport)' for > building DLL's. Actually, BC++ 5.2 (aka C++Builder 1) has some bugs in this regard -- it will occasionally ignore __declspec(dllexport) for seemingly random methods and functions and make the linker complain like crazy. Changing unrelated code would sometimes alleviate (or mutate) the problem, as did removing precompiled headers. __export and __import were not affected by this problem. C++ virtual destructors seemed to exhibit this behavior most frequently. C++Builder 3 (BC++ 5.3) does not seem to have this bug. You might want to consider instead: # if defined(__WIN32__) && (defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x500 && __BORLANDC__ != 0x520) || (defined(__GNUC__) && defined(__declspec))) # define DLLIMPORT __declspec(dllimport) # define DLLEXPORT __declspec(dllexport) #elif defined(__BORLANDC__) # define DLLIMPORT __import # define DLLEXPORT __export #else # define DLLIMPORT # define DLLEXPORT #endif -- 12/08/1999 hobbs
welch Deleted ticket [218319ffff].
[History diff]2000-10-26 08:19:00
dgp Ticket [218319ffff]: 3 changes
[History diff]2001-04-05 06:54:27
Log in (anonymous is fine) to add a comment.