This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getenv / relocatable dlls


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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]