www.digitalmars.com         C & C++   DMDScript  

c++ - Linker can’t find the file

reply jimp <jimp_member pathlink.com> writes:
I’m trying to compile with the following command line:
"C:\Program Files\dm\bin\dmc.exe"  "CTOCPP.C"  -l"listfile.txt"

The compile is ok and creates the object file CTOCPP.obj  (and listfile.txt)
with no errors.  When the linker starts I get the following message:

OPTLINK : Error 118 : Filename Expected
LIB="C:\Program Files\dm\bin\..\lib";"C:\Program Files\dm\bin\..\mfc\lib;"

The linker then terminates with exit code 1.

Does anyone know why this is happening?

Thanks,
jimp
Mar 02 2003
parent reply "Walter" <walter digitalmars.com> writes:
What does the command to the linker look like?

"jimp" <jimp_member pathlink.com> wrote in message
news:b3ttsk$m13$1 digitaldaemon.com...
 I'm trying to compile with the following command line:
 "C:\Program Files\dm\bin\dmc.exe"  "CTOCPP.C"  -l"listfile.txt"

 The compile is ok and creates the object file CTOCPP.obj  (and
listfile.txt)
 with no errors.  When the linker starts I get the following message:

 OPTLINK : Error 118 : Filename Expected
 LIB="C:\Program Files\dm\bin\..\lib";"C:\Program Files\dm\bin\..\mfc\lib;"

 The linker then terminates with exit code 1.

 Does anyone know why this is happening?

 Thanks,
 jimp
Mar 02 2003
parent reply jimp <jimp_member pathlink.com> writes:
When the linker is called the following message is displayed:

link CTOCPP,,,user32+kernel32/noi;





In article <b3u9d7$rlj$1 digitaldaemon.com>, Walter says...
What does the command to the linker look like?
Mar 03 2003
parent reply "Walter" <walter digitalmars.com> writes:
That looks fine. I suspect the problem is with the LIB environment variable.
What is that set to?

"jimp" <jimp_member pathlink.com> wrote in message
news:b3vu8m$1p1m$1 digitaldaemon.com...
 When the linker is called the following message is displayed:

 link CTOCPP,,,user32+kernel32/noi;





 In article <b3u9d7$rlj$1 digitaldaemon.com>, Walter says...
What does the command to the linker look like?
Mar 03 2003
parent reply "jimp" <jimp02 email.com> writes:
The sc.ini file is set at the defaults.  The file looks like this:

[Version]

version=7.51 Build 020



[Environment]

PATH=%PATH%;"% P%\..\bin"

BIN="% P%\..\bin"

INCLUDE="% P%\..\include";"% P%\..\mfc\include";"% P%\..\stl";%INCLUDE%

LIB="% P%\..\lib";"% P%\..\mfc\lib";%LIB%

HELP=% P%\..\help








"Walter" <walter digitalmars.com> wrote in message
news:b41gem$2okd$2 digitaldaemon.com...
 That looks fine. I suspect the problem is with the LIB environment
variable.
 What is that set to?
Mar 04 2003
parent reply "Walter" <walter digitalmars.com> writes:
"jimp" <jimp02 email.com> wrote in message
news:b42hc3$9cs$1 digitaldaemon.com...
 The sc.ini file is set at the defaults.  The file looks like this:

 [Version]

 version=7.51 Build 020



 [Environment]

 PATH=%PATH%;"% P%\..\bin"

 BIN="% P%\..\bin"

 INCLUDE="% P%\..\include";"% P%\..\mfc\include";"% P%\..\stl";%INCLUDE%

 LIB="% P%\..\lib";"% P%\..\mfc\lib";%LIB%

 HELP=% P%\..\help
Try deleting the LIB line (save a backup first, of course!)
Mar 04 2003
parent "jimp" <jimp02 email.com> writes:
Walter,



I found the problem.  The dm directory has a space in it (it is actually d
m).  I removed it and it works ok.  I have had the same problem with other
compilers.  It is actually in the Program Files (with a space) folder but
this didn't seem to matter.



Anyway, thanks for the help.  The last change you suggested caused it to do
something different which allowed me to find the problem.



Jimp






"Walter" <walter digitalmars.com> wrote in message
news:b42lli$bpm$2 digitaldaemon.com...
 Try deleting the LIB line (save a backup first, of course!)
Mar 04 2003