c++.command-line - Specifying libray search path to DMC with the -L option.
- BK (27/27) Nov 14 2005 First off, let me say thank you for this great product.
- Derek Parnell (22/58) Nov 14 2005 The OptLink program does not have a switch that can be used to pass a
- BK (3/6) Nov 17 2005 ^^^^^^^^^^^^^^^^^
- BK (4/9) Nov 17 2005 It appears the posting software removed initial spaces from my previous
-
Scott Michel
(4/16)
Nov 17 2005
link
, , ,lib1 lib2 \my\lib\path\
First off, let me say thank you for this great product. The -L option seems to be serving several overlapping purposes. The documentation states: * -Llinker Use linker linker instead of default. This is useful if a special linker is being used, or if the linker is not on the PATH or in the directory where dmc resides. For example, -L\path\mylink tells the compiler to run the MYLINK linker in the \path directory. * -L/switch Pass /switch to linker. For example, this command: dmc test -L/packcode -L\test\prog adds the option /packcode and the library search path \test\prog to the linker's command line. In the second form of that last example, the \test\prog is being interpreted as a replacement linker, which obviously does not exist..it's a directory where libraries are located. Replacing it with its absolute path doesn't help. Clearly, the -L cannot serve two different purposes with the same syntax: set PATH=c:\bin\dm\bin;%PATH% dmc -cpp -Aa -Ab -Ae -Ar -Aw -w3 -Ic:\bin\dm\stlport\stlport (continued..) -I\test\prog -L\test\prog foo.c util.lib \test\prog foo,,,util+user32+kernel32/noi; Can't run '\test\prog', check PATH So my question is: what is the proper way of adding a library search path? I know about modifying the LIB environment variable, but that's infeasible. Obviously, I'm misunderstanding something as this is a no-brainer for any other compiler. Thanks.
Nov 14 2005
On Mon, 14 Nov 2005 10:00:34 +0000 (UTC), BK wrote:First off, let me say thank you for this great product. The -L option seems to be serving several overlapping purposes. The documentation states: * -Llinker Use linker linker instead of default. This is useful if a special linker is being used, or if the linker is not on the PATH or in the directory where dmc resides. For example, -L\path\mylink tells the compiler to run the MYLINK linker in the \path directory. * -L/switch Pass /switch to linker. For example, this command: dmc test -L/packcode -L\test\prog adds the option /packcode and the library search path \test\prog to the linker's command line. In the second form of that last example, the \test\prog is being interpreted as a replacement linker, which obviously does not exist..it's a directory where libraries are located. Replacing it with its absolute path doesn't help. Clearly, the -L cannot serve two different purposes with the same syntax: set PATH=c:\bin\dm\bin;%PATH% dmc -cpp -Aa -Ab -Ae -Ar -Aw -w3 -Ic:\bin\dm\stlport\stlport (continued..) -I\test\prog -L\test\prog foo.c util.lib \test\prog foo,,,util+user32+kernel32/noi; Can't run '\test\prog', check PATH So my question is: what is the proper way of adding a library search path? I know about modifying the LIB environment variable, but that's infeasible. Obviously, I'm misunderstanding something as this is a no-brainer for any other compiler. Thanks.The OptLink program does not have a switch that can be used to pass a library path to it. It only accepts library paths from the LIB environment symbol, the command line, and a 'response' file. But if you are invoking the linker from DMC then you have no control over these methods. The only convenient way is to modify the sc.ini file that resides in the same directory as dmc.exe. In that file you should see a LIB= line. Append the path to library on to this line. e.g. LIB=LIB=c:\dm\lib;e:\mylibs\special Also be sure to change the attributes of the sc.ini file to read-only because each new install of DMC will otherwise replace your updated sc.ini with the default one. But even then, you still have to unzip the files one-by-one so the ZIP program doesn't accidentally destroy your updates to sc.ini. This is not a brilliant solution but its the only one that Walter advocates. He's not going to change OptLink to be more useful. -- Derek (skype: derek.j.parnell) Melbourne, Australia 15/11/2005 10:05:22 AM
Nov 14 2005
In article <1vszg0zyd4gb6$.sf9omivzndad$.dlg 40tude.net>, Derek Parnell says...The OptLink program does not have a switch that can be used to pass a library path to it. It only accepts library paths from the LIB environment symbol, the command line, and a 'response' file. But if you are invoking^^^^^^^^^^^^^^^^^ Can you give an example of this?
Nov 17 2005
In article <dljhhv$6u4$1 digitaldaemon.com>, BK says...In article <1vszg0zyd4gb6$.sf9omivzndad$.dlg 40tude.net>, Derek Parnell says...It appears the posting software removed initial spaces from my previous message. What I meant was can you give an example of it accepting library paths from the command line. Thank you.The OptLink program does not have a switch that can be used to pass a library path to it. It only accepts library paths from the LIB environment symbol, the command line, and a 'response' file. But if you are invoking
Nov 17 2005
BK wrote:In article <dljhhv$6u4$1 digitaldaemon.com>, BK says...link <link flags> <objects>,<exename>,<mapfile>,lib1 lib2 \my\lib\path\ lib3 lib4 lib5,<def file>,<res file> Just put the directory name in the list of libraries.In article <1vszg0zyd4gb6$.sf9omivzndad$.dlg 40tude.net>, Derek Parnell says...It appears the posting software removed initial spaces from my previous message. What I meant was can you give an example of it accepting library paths from the command line. Thank you.The OptLink program does not have a switch that can be used to pass a library path to it. It only accepts library paths from the LIB environment symbol, the command line, and a 'response' file. But if you are invoking
Nov 17 2005