www.digitalmars.com         C & C++   DMDScript  

c++.command-line - Optlink and long environment variables

reply Kazuhiro Inaba <kiki kmonos.net> writes:
Optlink ignores environment variables like LIB, if
there are other long env vars. Here's a reproducing example:

 type hello.c

 type world.c

 dmc -c hello.c
 lib -c c:\hello.lib hello.obj
 set LIB=c:\
 dmc world.c hello.lib

Yes, everything is ok up to here. "C:\hello.lib" is found and linked.
 set

6789012345678901234567890123456789
 set A=%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%%A%

But when there is long environment variables...
 dmc world.c hello.lib

OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved hello.lib Warning 2: File Not Found hello.lib world.obj(world) Error 42: Symbol Undefined _hello --- errorlevel 1 The linker seems to fail reading the LIB variable. Is there a way to remedy this? I know that the linker reads "sc.ini" and LIB variable can also be set there (and it works even if there're long envvars), but i'd like to set it by environment variables if possible.
Dec 05 2006
parent Walter Bright <newshound digitalmars.com> writes:
Kazuhiro Inaba wrote:
 Is there a way to remedy this?

I'm sorry, but not at the moment.
Dec 08 2006