September 21, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark Evans | "Mark Evans" wrote > Walter, > > You should promote the use of sc.ini more often. I like programs that are self-contained and require no registry or environment settings. Especially when > I also have MSVC6 on board, which does! > > Sc.ini should be the preferred method IMHO. > > Mark > > > > >The library search path is controlled by the LIB environment variable: > > > > www.digitalmars.com/ctg/optlink.html#environment > > > I was under the impression that the settings in the '.ini' file were just used to set the environment variables. And BTW, it seems that the default paths are still checked first, even when you set 'LIB' / 'INCLUDE'. Is there no way to over-ride these paths other than change their names? -- Marc. |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Kealy | i have msvc too i've been working on batch files to help me use both from the command line... these might help you, might not, but i usually set include= and lib= when using digital mars it seems to run just fine without them. might take some editing if you want to use these, but it's just an example... --- @echo off rem this is cppvars.bat if "%1"=="dm" goto dm if "%1"=="ms" goto ms if "%CPP%"=="" set CPP=none echo Sets Environment for C++ Programming echo Usage: cppvars [MS or DM] echo MS=Microsoft echo DM=Digital Mars echo current: %CPP% if "%CPP%"=="none" set CPP= goto end :dm if "%CPP%"=="MS" call msvcvars.bat call dmcvars.bat goto end :ms if "%CPP%"=="DM" call dmcvars.bat call msvcvars.bat goto end :end rem end cppvars.bat --- @echo off rem dmcvars.bat if "%CPP%"=="DM" goto remove subst s: c:\cpp\dm set path=s:\bin;c:\windows;c:\windows\command;c:\xdos; set INCLUDE= set LIB= set CPP=DM echo DM++ variables set goto end :remove c: subst s: /d set path=c:\windows;c:\windows\command;c:\xdos; set CPP= echo DM++ variables removed goto end :end rem end dmcvars.bat --- @echo off rem msvcvars.bat if "%CPP%"=="MS" goto remove set TOOLROOTDIR=C:\MSVC set PATH=C:\MSVC\BIN;c:\windows;c:\windows\command;c:\xdos; set INCLUDE=C:\MSVC\INCLUDE;C:\MSVC\MFC\INCLUDE; set LIB=C:\MSVC\LIB;C:\MSVC\MFC\LIB; set CPP=MS echo MSVC++ variables set goto end :remove set CPP= set TOOLROOTDIR= set INCLUDE= set LIB= set PATH=c:\windows;c:\windows\command;c:\xdos; echo MSVC++ variables removed :end rem end msvcvars.bat --- |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Kealy | "Marc Kealy" <marc@kealy.fslife.co.uk> wrote in message news:amj0cn$1ig3$1@digitaldaemon.com... > I was under the impression that the settings in the '.ini' file were just used to set the environment variables. They do, but only for child processes. They do not change the global environment settings. > And BTW, it seems that the default paths are still checked first, even when > you set 'LIB' / 'INCLUDE'. What do you mean by the default paths? |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to bw | "bw" wrote > i have msvc too i've been working on batch files to help me use both from the > command line... these might help you, might not, but i usually set include= and > lib= when using digital mars it seems to run just fine without them. might take > some editing if you want to use these, but it's just an example... > > [snip code...] Thanks bw, but as I'm running DM from within my own IDE, I can save the VC strings, set the DM strings, run a compile and then reset the VC strings: Which is no more hassle than writing the initial code to do so. No, the real problem is when you want to use DM and VC at the same time. If you start a compile with DM, you don't want to have to sit and wait for it to finish before you can use VC. You could waste an awful lot of hours in day like that. This example only uses these two compilers, but there are many other compilers out there and there are probably many more on the way. Who's to know what combinations of tools (and environment variables) people are going to be using. This is why it's far safer and more convenient (in a broader view) to bypass the environment variables and set paths, etc. explicitly. -- Marc. |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" wrote > > "Marc Kealy" wrote > > I was under the impression that the settings in the '.ini' file were just > > used to set the environment variables. > > They do, but only for child processes. They do not change the global environment settings. > > > And BTW, it seems that the default paths are still checked first, even > when > > you set 'LIB' / 'INCLUDE'. > > What do you mean by the default paths? > If I wanted to substitute one of the windows headers, for example, I would need to replace it in the 'DM\Include\Win32\' dir instead of putting it in '\MyHeaders\' and telling sc to search 'MyHeaders' before 'DM\Include\Win32\'. -- Marc. |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Kealy | "Marc Kealy" <marc@kealy.fslife.co.uk> wrote in message news:amj75g$2809$1@digitaldaemon.com... > If I wanted to substitute one of the windows headers, for example, I would need to replace it in the 'DM\Include\Win32\' dir instead of putting it in '\MyHeaders\' and telling sc to search 'MyHeaders' before 'DM\Include\Win32\'. Just go: -I\myheaders or in sc.ini: INCLUDE=\myheaders;\dm\include\win32 |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" wrote > > "Marc Kealy" <marc@kealy.fslife.co.uk> wrote in message news:amj75g$2809$1@digitaldaemon.com... > > If I wanted to substitute one of the windows headers, for example, I would > > need to replace it in the 'DM\Include\Win32\' dir instead of putting it in > > '\MyHeaders\' and telling sc to search 'MyHeaders' before 'DM\Include\Win32\'. > > Just go: -I\myheaders > or in sc.ini: > INCLUDE=\myheaders;\dm\include\win32 > Yes! A bit silly, that one. I just changed the '.ini' file from:- INCLUDE=...default-paths...;%INCLUDE% to:- INCLUDE=%INCLUDE%;...default-paths... and that's that one solved. It's 4:30 am here! That's my excuse. -- Marc. |
September 22, 2002 Re: library search path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Kealy | "Marc Kealy" <marc@kealy.fslife.co.uk> wrote in message news:amjcvr$30l9$1@digitaldaemon.com... > and that's that one solved. Glad it's working for you now. I wish all problems were so easilly resolved! |
Copyright © 1999-2021 by the D Language Foundation