c++ - library search path
- Marc Kealy (8/8) Sep 21 2002 Hi,
- Jan Knepper (5/8) Sep 21 2002 Yes, that's what you do.
- Marc Kealy (9/17) Sep 21 2002 In the docs for sc, it says that you can also use '-L' to pass arguments...
- Jan Knepper (4/26) Sep 21 2002 That's -L/
- Marc Kealy (26/56) Sep 21 2002 Jan,
- Jan Knepper (3/10) Sep 21 2002 What about -L/-Lc:\test\prog ???
- Marc Kealy (5/16) Sep 21 2002 No. I've tried a few different things like that.
- Walter (6/28) Sep 21 2002 The library search path is controlled by the LIB environment variable:
- Mark Evans (6/8) Sep 21 2002 Walter,
- Walter (6/17) Sep 21 2002 Yes, you are right. I wish more programs were self-contained. I had to k...
- Marc Kealy (9/20) Sep 21 2002 I was under the impression that the settings in the '.ini' file were jus...
- bw (68/68) Sep 21 2002 i have msvc too i've been working on batch files to help me use both fro...
- Marc Kealy (19/24) Sep 21 2002 include= and
- Walter (6/10) Sep 21 2002 They do, but only for child processes. They do not change the global
- Marc Kealy (8/17) Sep 21 2002 If I wanted to substitute one of the windows headers, for example, I wou...
- Walter (5/9) Sep 21 2002 Just go: -I\myheaders
- Marc Kealy (11/20) Sep 21 2002 in
- Walter (3/4) Sep 21 2002 Glad it's working for you now. I wish all problems were so easilly resol...
Hi, I have a problem with extending the lib search path, ie:- -LC:\MyLibs seems to make sc think that I'm specifying a linker that it can't find. I'm very new to DM, so I'm assuming that this is a fundamental oversite on my part. -- Marc.
Sep 21 2002
Marc Kealy wrote:I have a problem with extending the lib search path, ie:- -LC:\MyLibs seems to make sc think that I'm specifying a linker that it can't find.Yes, that's what you do. When you start sc.exe or dmc.exe without paramters it will tell you what -L is for. Jan
Sep 21 2002
In the docs for sc, it says that you can also use '-L' to pass arguments to the linker and gives an example of passing both a switch and a lib search path. If this is not the prefered method, could anybody tell me what is? Thanks -- Marc. "Jan Knepper" wroteMarc Kealy wrote:what -L isI have a problem with extending the lib search path, ie:- -LC:\MyLibs seems to make sc think that I'm specifying a linker that it can't find.Yes, that's what you do. When you start sc.exe or dmc.exe without paramters it will tell youfor. Jan
Sep 21 2002
That's -L/ with -L you specify the linker (most likely an external one) with -L/ you specify arguments to the linker. Marc Kealy wrote:In the docs for sc, it says that you can also use '-L' to pass arguments to the linker and gives an example of passing both a switch and a lib search path. If this is not the prefered method, could anybody tell me what is? Thanks -- Marc. "Jan Knepper" wroteMarc Kealy wrote:what -L isI have a problem with extending the lib search path, ie:- -LC:\MyLibs seems to make sc think that I'm specifying a linker that it can't find.Yes, that's what you do. When you start sc.exe or dmc.exe without paramters it will tell youfor. Jan
Sep 21 2002
Jan, I appreciate you taking the time to answer my questions, but please don't assume that I'm an idiot. Although I'm new to DM, I'm quite familiar with the concepts of using compilers (Borland + GCC). Now, in order to extend the lib search, I can find two options: 1. Use the 'LIB' environment variable. This is a last resort for me. 2. Use -L???. This is what the manual says:- -L/switch Pass /switch to linker. For example, this command: sc test -L/packcode -L\test\prog adds the option /packcode and the library search path \test\prog to the linker's command line. You'll notice that the second argument of this example dosn't use the '/' charactor, but goes straight into a relative path. Now, a relative path is not what I want, I want to use an absolute path. So, what I'd like to know is:- Is there a way to use the '-L' switch to add an absolute path to the lib search? If not; Are there other options than those above? How do you do it? -- Marc. "Jan Knepper" wroteThat's -L/ with -L you specify the linker (most likely an external one) with -L/ you specify arguments to the linker. Marc Kealy wrote:toIn the docs for sc, it says that you can also use '-L' to pass argumentssearchthe linker and gives an example of passing both a switch and a libfind.path. If this is not the prefered method, could anybody tell me what is? Thanks -- Marc. "Jan Knepper" wroteMarc Kealy wrote:I have a problem with extending the lib search path, ie:- -LC:\MyLibs seems to make sc think that I'm specifying a linker that it can'tYes, that's what you do. When you start sc.exe or dmc.exe without paramters it will tell youwhat -L isfor. Jan
Sep 21 2002
1. Use the 'LIB' environment variable. This is a last resort for me.That would work.2. Use -L???. This is what the manual says:- -L/switch Pass /switch to linker. For example, this command: sc test -L/packcode -L\test\prog adds the option /packcode and the library search path \test\prog to the linker's command line.What about -L/-Lc:\test\prog ??? Jan
Sep 21 2002
"Jan Knepper" <jan smartsoft.cc> wrote in message news:3D8CB83D.392328AC smartsoft.cc...No. I've tried a few different things like that. -- Marc.1. Use the 'LIB' environment variable. This is a last resort for me.That would work.2. Use -L???. This is what the manual says:- -L/switch Pass /switch to linker. For example, this command: sc test -L/packcode -L\test\prog adds the option /packcode and the library search path \test\prog to the linker's command line.What about -L/-Lc:\test\prog ??? Jan
Sep 21 2002
The library search path is controlled by the LIB environment variable: www.digitalmars.com/ctg/optlink.html#environment "Marc Kealy" <marc kealy.fslife.co.uk> wrote in message news:ami76c$2ld0$1 digitaldaemon.com...In the docs for sc, it says that you can also use '-L' to pass argumentstothe linker and gives an example of passing both a switch and a lib search path. If this is not the prefered method, could anybody tell me what is? Thanks -- Marc. "Jan Knepper" wrotefind.Marc Kealy wrote:I have a problem with extending the lib search path, ie:- -LC:\MyLibs seems to make sc think that I'm specifying a linker that it can'tYes, that's what you do. When you start sc.exe or dmc.exe without paramters it will tell youwhat -L isfor. Jan
Sep 21 2002
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. MarkThe library search path is controlled by the LIB environment variable: www.digitalmars.com/ctg/optlink.html#environment
Sep 21 2002
Yes, you are right. I wish more programs were self-contained. I had to keep after people to keep this working, the install programmers kept wanting to muck with the system directory and registry settings <g>. "Mark Evans" <Mark_member pathlink.com> wrote in message news:amip9g$udg$1 digitaldaemon.com...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 whenI also have MSVC6 on board, which does! Sc.ini should be the preferred method IMHO. MarkThe library search path is controlled by the LIB environment variable: www.digitalmars.com/ctg/optlink.html#environment
Sep 21 2002
"Mark Evans" wroteWalter, 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 whenI also have MSVC6 on board, which does! Sc.ini should be the preferred method IMHO. MarkI 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.The library search path is controlled by the LIB environment variable: www.digitalmars.com/ctg/optlink.html#environment
Sep 21 2002
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 ---
Sep 21 2002
"bw" wrotei have msvc too i've been working on batch files to help me use both fromthecommand line... these might help you, might not, but i usually setinclude= andlib= when using digital mars it seems to run just fine without them.might takesome 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.
Sep 21 2002
"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, evenwhenyou set 'LIB' / 'INCLUDE'.What do you mean by the default paths?
Sep 21 2002
"Walter" wrote"Marc Kealy" wrotejustI was under the impression that the settings in the '.ini' file wereIf 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.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, evenwhenyou set 'LIB' / 'INCLUDE'.What do you mean by the default paths?
Sep 21 2002
"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
Sep 21 2002
"Walter" wrote"Marc Kealy" <marc kealy.fslife.co.uk> wrote in message news:amj75g$2809$1 digitaldaemon.com...wouldIf I wanted to substitute one of the windows headers, for example, Iinneed to replace it in the 'DM\Include\Win32\' dir instead of putting itYes! 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.'\MyHeaders\' and telling sc to search 'MyHeaders' before 'DM\Include\Win32\'.Just go: -I\myheaders or in sc.ini: INCLUDE=\myheaders;\dm\include\win32
Sep 21 2002
"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!
Sep 21 2002