Re: Tcl Dll problem



On 13 Jul 2006 12:35:28 -0700, "China" <davide.belloni@xxxxxxxxx>
wrote:

Hi,
I've developed a set of API to use BerkeleyDB in a management
information system developed in TCL. In Linux there's no problem, i can
compile it, and it work fine putting the right path for BDB library
.so.
In Windows I can compile the APi without an error, but when i excecute
the TCL program it return this error:

Couldn't load library "C:\xxx\libtclctree\libtclctree.dll": this
library or a dependent library could not be found in library path
while executing
"load C:\xxx\libtclctree\libtclctree.dll tclctree"
...

The name libtclctree.dll is the name for BDB dll that i've create and
i've give this name for wrap a lib pre-existing and see more easely if
program starts( the same thing is in linux version). I've execute
depends.exe, but it return that all dependencies is resolved.
I don't understand why it can't load this dll.
Thanks for each help!
Hi,
one possible reason is that the DLL's init function is not exported.
On Linux (AFAIK) _all_ functions are exported but on Windows you have
to tell the compiler which ones you want exported by decorating those
with
__declspec(dllexport)

It is often done like this

#ifdef <compiling on Windows>
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT
#endif

and declaring your init function like
DLL_EXPORT int Your_Init( Tcl_Interp *interp)
so that under Windows you get the decoration and under Linux it
disappears.
HTH
Helmut Giese
.



Relevant Pages

  • Re: CEPTCL: Doesnt RX multicast, has anyone seen it work before?
    ... on my Linux. ... gave me are set up to compile for windows. ... has all of the files and the makefile is set up for Linux too. ... please modify the Makefile for proper Tcl path. ...
    (comp.lang.tcl)
  • Re: free database server for desktop application with ado.net driv
    ... I've used MySQL on Windows since its 3.x days, ... So what if it is GNU and supports linux? ... You're missing the point - you do not have to compile it yourself. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is CMUCL insane? P.S. Me vs. CLM (Common Lisp Music)
    ... Or to build Windows without a working version of Windows. ... why are you trying to compile CMUCL?" ... let's assume I use Linux and not an emulator here... ...
    (comp.lang.lisp)
  • Re: Standard Database Interface?
    ... Windows binary and examples athttp://aspn.activestate.com/ASPN/Cookbook/Tcl?kwd=TclBlend. ... use native tcl and binary packages. ... and Java i.e Tcl/TK 8.4.13 and Java 1.4.2.12. ... patient enough to show me a step by step method on how to compile ...
    (comp.lang.tcl)
  • Re: Standard Database Interface?
    ... Windows binary and examples athttp://aspn.activestate.com/ASPN/Cookbook/Tcl?kwd=TclBlend. ... use native tcl and binary packages. ... patient enough to show me a step by step method on how to compile ... The physical location of the Java runtime is specified at compile ...
    (comp.lang.tcl)