Click to See Complete Forum and Search --> : nmake troubles


StoneRaven
March 30th, 2007, 04:31 PM
Hello,

I am trying to compile a library for a freeware embedded web server ( http://shttpd.sourceforge.net/#license ) using nmake.exe that came with Visual Studio 6.0.

To that end I copied NMAKE.EXE into the src folder where the Makefile and other code is and attempted to compile. I got the following error: fatal error u1077 : ‘cl’ return code ‘0x1’. So next I moved in CL.EXE into the src folder and tried again. This time CL.exe complained that it couldn’t find the mspdb60.dll. I then copied all the source files to be compiled into the C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin folder and attempted to run nmake from there. CL.exe still complained about mspdb60.dll. After some web searching I found some info that said to copy the mspdb60.dl, RC.EXE, and rcdll.dll into the bin with the NMAKE and tried yet again. This time I got a new error (fatal error: C1083 : cannot open include file : ‘sys/types.h’).

Any ideas? Can anyone else successfully compile the library? You can download it yourself through the site's home page http://shttpd.sourceforge.net/#license

Thank you very much for any help.

VCVCVC
March 30th, 2007, 05:11 PM
Either in your Options -> Include (or)

In project->Settings->C++ tab->Additional includes...Please include the path of the Sys folder and in the Link tab include the Sys libs.

I suspect you dont have the incl and the Lib path set for your project.

MrViggy
March 30th, 2007, 05:37 PM
To do command line compilation using Dev Studio 6.x, you need to set your env vars properly. If you didn't let the installer do it, there should be a bat file to do it for you. Look for it in:

C:\{Dev studio install}\vc98\bin\vcvars32.bat

Run that in your command window, then try running nmake. You should not have to copy anything into your project directory.

Viggy

StoneRaven
March 30th, 2007, 06:30 PM
Thank you for the replies and help. I finally got it built with your assistance!!! Below is what I tried and what finally worked. Hope this can help someone else.

I ran the vcvars32.bat successfully and put my source files in their own directory, copied the nmake into the folder and tried to compile again and got the following error from the command line.

Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

cl string.c shttpd.c log.c auth.c md5.c cgi.c mime_type.c config.c io_
file.c io_socket.c io_ssl.c io_emb.c io_dir.c io_cgi.c /c /O1 /MD /TC /nologo /D
NDEBUG /DEMBEDDED
'cl' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'cl' : return code '0x1'
Stop.

This is the same error I got originally. So then I copied the files back into the .\VC98\bin folder again and recompiled. Same complaint about the mspdb60.dll.

So I finally I decided to follow Mr. Viggy's directions exactly (what an idea!!!). I ran the vcvars32.bat file from the command line ( while in the ..\VC98\bin folder where my sourece files were also located) and then ran nmake.exe. It worked!!! The key was having my files in the ..\VC98\bin and running the vcvars32.bat file right before the nmake call.

Thanks again.

MrViggy
March 30th, 2007, 06:42 PM
Actually, the "key" is the 'vcvars32.bat'. This sets your PATH to find all the proper compiler executables and DLL's; sets your INCLUDE path to find all the proper header files; and sets your LIBRARY path to find all the proper .lib files.

:D

Viggy

StoneRaven
March 30th, 2007, 06:53 PM
I admit I have done very little command line compiling so am still a little confused. Why didn't my source compile from its normal directory even after running vcvars32.bat and then copying in nmake.exe? Actually, even after I copied my source files into the \VC98\bin dir. it still didn't work. I had to run the vcvars32.bat file again right before I ran nmake. Is that the thing with the environment variables (set with vcvars32.bat), they are only configured for the existing command prompt/box/shell?