delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/06/17:17:59

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <99B82AA9708ED0119B55006097125A00363ED0@ifk63.mach.uni-karlsruhe.de>
From: Heribert Dahms <heribert_dahms AT icon-gmbh DOT de>
To: "'Andrej Borsenkow'" <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>,
cygwin AT sourceware DOT cygnus DOT com
Subject: RE: Accessing exported variables in DLL with dlsym().
Date: Thu, 6 Jul 2000 23:10:03 +0200
X-Priority: 3
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1457.3)

Hi Andrej,

if you can rebuild the DLL from source, you may do what TCL/TK
did years ago due to this Win* deficiency: Add simple wrapper
functions which just return the pointer to one of your variables.

Bye, Heribert (heribert_dahms AT icon-gmbh DOT de)

> -----Original Message-----
> From:	Andrej Borsenkow [SMTP:Andrej DOT Borsenkow AT mow DOT siemens DOT ru]
> Sent:	Thursday, July 06, 2000 10:59
> To:	cygwin AT sourceware DOT cygnus DOT com
> Subject:	Accessing exported variables in DLL with dlsym().
> 
> I am trying to port a program that opens dynamic library with dlopen()
> and looks up symbol with dlsym(). This works for function reference
> but
> not for variable. The porgram is:
> 
> main.c:
> 
> #include <dlfcn.h>
> #include <stdio.h>
> 
> main() {
>     int (*foo)(void);
>     void *libfoo;
> 
>     libfoo = dlopen ("libfoo.dll", 0);
>     foo = dlsym (libfoo, "foo");
>     foo();
> }
> 
> foo.c:
> 
> #include <stdio.h>
> #include <dlfcn.h>
> 
> __declspec (dllexport) extern foo (void);
> 
> foo() {
>     char *bar;
>     void *libbar;
> 
>     libbar = dlopen ("libbar.dll", 0);
>     bar = dlsym (libbar, "bar");
>     puts (bar);
> }
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019