Subject: getenv / relocatable dlls
From: [email-masked] (Kees van Veen)

6 Nov 1997 01:12:15 -0800
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

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
"[email-masked]" with one line of text: "help".