Tcl extensions built with lcc-win32
- From: odt@xxxxxxx (Olaf Dietrich)
- Date: Wed, 30 Apr 2008 07:28:04 +0000 (UTC)
I'm currently trying to build a Tcl extension with the lcc-win32
compiler (platform windows xp, Tcl/Tk: ActiveState ActiveTcl 8.5.2.0).
This basically worked after transforming the Tcl libraries (tcl85.lib,
tk85.lib) to the lcc format (using the lcc GUI application "wedit" and
the menu option "Utils -> Import foreign library").
I could build and load my extension, but only when linking with the
non-stubs libraries (tcl85.[lib|dll], tk85.[lib|dll]). However, I was not
able to build a version of the extension using the Tcl stubs mechanism,
i.e. linking with the tclstub85.lib library (which I also transformed
to the lcc format). The dll of my extension is built without any
errors or warnings, but when I attempt to load the extension, Tcl
complains:
% load /path/to/extension.dll
couldn't load library "/path/to/extension.dll": this library or a dependent library could not be found in library path
I checked the dll with dumpbin.exe, the result is attached at the end
of this message. It seems that something is wrong with the functions
from the stubs library, however, I don't fully understand the
differences in linking and library inclusion for extensions without
and with the stubs mechanisms ...
It is BTW possible to build the extension with the Visual Express C++
compiler (both the non-stubs and the stubs version).
I found an old message indicating that the problem may be related
to the fact that the ActiveTcl libraries are built with the
Microsoft compiler:
Subject: Re: Winico using stubs library
Date: 2000/05/28
Newsgroups: comp.lang.tcl
Message-ID: <8gqi94$qhm$1@xxxxxxxxxxxxxxxxxxxx>
Do you think that there is a way to work around this problem, i.e.
to use the ActiveTcl stubs-libraries in combination with lcc-win32?
Thanks for any suggestions,
Olaf
Here the mentioned output of dumpbin.exe; the problems are probably
related to the first section: "Name of the dll unknown!"
C:\Path>dumpbin -imports extension.dll
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file extension.dll
File Type: DLL
Section contains the following imports:
Name of the dll unknown!
100040CC Import Address Table
10004084 Import Name Table
0 time date stamp
0 Index of first forwarder reference
2 Tcl_InitStubs
6 tclStubsPtr
KERNEL32.dll
100040DC Import Address Table
10004094 Import Name Table
0 time date stamp
0 Index of first forwarder reference
9B ExitProcess
124 GetEnvironmentStringsA
278 RtlUnwind
CRTDLL.DLL
100040F0 Import Address Table
100040A8 Import Name Table
0 time date stamp
0 Index of first forwarder reference
80 _fdopen
14F _open_osfhandle
20D fclose
39 _cexit
24E malloc
260 raise
267 setbuf
Summary
1000 .data
1000 .edata
1000 .idata
1000 .rdata
1000 .reloc
1000 .text
.
- Follow-Ups:
- Prev by Date: Re: returning coordinates of canvas objects in integer values
- Next by Date: Re: glob behaviour changed in 8.4, documented?
- Previous by thread: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- Next by thread: Re: Tcl extensions built with lcc-win32
- Index(es):
Relevant Pages
|