From: cvn AT interchain DOT nl (Kees van Veen) Subject: getenv / relocatable dlls 6 Nov 1997 01:12:15 -0800 Message-ID: <34617E27.79D.cygnus.gnu-win32@interchain.nl> Reply-To: cvn AT interchain DOT nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: gnu-win32 AT cygnus DOT com Hi, some days ago I posted a message concerning using multiple DLL's from one program, but got no response. I'm have come a little bit farther though, using William Greathouse's dllfix.exe (see http://www.cygnus.com/ml/gnu-win32/1997-Jul/0047.html), but am having trouble getting getenv() to work from within the DLL. main() { rout("HOME"); printf("HOME=%s\n", getenv("HOME")); } rout(s) char *s; { printf("%s = %s\n", s, getenv(s)); } If I make a relocatable DLL from rout() using http://www.cygnus.com/misc/gnu-win32/building-reloc-dlls.txt, rout() prints null and main() prints "//C/". This happens with all environment variables. I added '-lc -lcygwin -lkernel32 -lc' as linker libraries. I'm using b18 and Sergey's latest dll. Does anyone know what I'm doing wrong ? Tnanks in advance, Kees - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".