Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 To: "'Andrej Borsenkow'" , 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) Content-Type: text/plain 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 > #include > > main() { > int (*foo)(void); > void *libfoo; > > libfoo = dlopen ("libfoo.dll", 0); > foo = dlsym (libfoo, "foo"); > foo(); > } > > foo.c: > > #include > #include > > __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