Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - library search path
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. 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: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. 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: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. 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:In the docs for sc, it says that you can also use '-L' to pass arguments Sep 21 2002
1. Use the 'LIB' environment variable. This is a last resort for me. Sep 21 2002
"Jan Knepper" <jan smartsoft.cc> wrote in message news:3D8CB83D.392328AC smartsoft.cc...1. Use the 'LIB' environment variable. This is a last resort for me. 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 arguments 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. 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. 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 from 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. Sep 21 2002
"Walter" wrote"Marc Kealy" wroteI was under the impression that the settings in the '.ini' file were 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\'. Sep 21 2002
"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 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. Sep 21 2002
|