Haven't used nmake in quite a while.  I have a library I need to compile from C source.  I ran vcvars32.bat.  I installed the VS Toolkit and copied nmake from elsewhere and put it in the bin folder of the kit. 

Everyone says it works by just doing nmake -f (filename) but I keep getting the error "can't make /include/fcgi_lib.h".  I did this:  nmake -f c:\fcgi\makefile.nt

So then I put nmake in the fcgi folder but this time it says it can't find cl.exe to compile it.

I know I'm forgetting something stupid so can a brother give a helping hand?
Posted on 2006-05-13 18:08:19 by drhowarddrfine
Perhaps you need to do something to the effect of...

set INCLUDE=%INCLUDE%;c:\fcgi\include

before running nmake?

Could you provide an URL to 'fcgi' if it's something publicly available?
Posted on 2006-05-14 02:50:29 by f0dder
FastCGI Development Kit.
This is only a 0.5M download.  I shortened the name to fcgi.  If you can figure out how to create this, I'd appreciate it.
Posted on 2006-05-14 09:41:18 by drhowarddrfine
A URL, please.
Posted on 2006-05-14 13:44:01 by PBrennick
Paul, which theme are you using? My theme doesn't distinguish URLs from normal text in any way >_<, until I hover the mouse above them... The URL is at FastCGI Development Kit ( http://fastcgi.com/#TheDevKit ).

Howard, I hope I'll have some time tomorrow to look at it.
Posted on 2006-05-14 16:41:27 by f0dder
Thanks.  Yes, hover over the url for me, too.
Posted on 2006-05-14 18:33:09 by drhowarddrfine
Control Panel -> System -> Advanced -> Environment Variables

to "include" add your include folders
to "lib" - the libs
to "path" - the folders of your cl.exe, nmake and all other necessary apps.

every new path is terminated with a ";"

For instance, my "path" has the value:

C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;D:\PalmOSCygwin;D:\masm32\bin;D:\Dev-Cpp\VCToolkit
Posted on 2006-05-15 04:36:27 by Ultrano
I tried "nmake -f makefile.nt" , worked as it should :), the examples .exe were all built.
Posted on 2006-05-15 04:49:39 by Ultrano
If you don't want to set the environment variables permanently, you can do "set PATH=blablabla;blubblub;kaka" etc. from your cmd.exe prompt. Also, if you use Visual Studio, there's a "vcvars.bat" you can run to set the variables automagically.
Posted on 2006-05-15 05:46:01 by f0dder
Well, I did all that, which is why I figured I must have forgotten how to do this.  Obviously, I did something wrong so I'm going to start from scratch again. 

I do not have VS installed, just the Toolkit, but I don't think that makes any difference.
Posted on 2006-05-15 10:15:03 by drhowarddrfine
So, with nmake in the bin file
c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin
I run nmake -f c:\fcgi\makefile.nt and I get the following error:
"cl.exe is not recognized as an internal or external command"

I get the same error if I run nmake from c:\fcgi

If I move nmake to c:\Program Files\Microsoft Visual C++ Toolkit 2003, I get:
"don't know how to make include\fcgi_config_x86.h"

Here is what I have set in env variables per Ultrano's instructions above:
INCLUDE c:\fcgi\include;c:\Microsoft Visual C++ Toolkit 2003\include;
LIB c:\fcgi\libfcgi;c:\Microsoft Visual C++ Toolkit 2003\lib;
PATH %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\gs\gs8.51\bin;C:\Program Files\QuickTime\QTSystem\;c:\Microsoft Visual C++ Toolkit 2003\bin;

EDIT:  Is LIB supposed to be LIBS?  Tried both ways but got same errors.
Do I need to restart after changing these?  I have before with no difference.
Posted on 2006-05-15 12:09:11 by drhowarddrfine

Manually switch to the directory where Makefile.nt is located and do 'nmake -f Makefile.nt'.
(nmake should be located in it's original dir. i.e. c:\Microsoft Visual C++ Toolkit 2003\bin)

Otherwise if you run nmake from other dir and specify full path i.e. 'nmake -f c:\fcgi\makefile.nt' all the paths inside the makefile will be treated relatively to the current user dir - hence the "don't know how to make include\fcgi_config_x86.h" error.
Posted on 2006-05-15 13:37:46 by arafel
I tried that but when nmake is not in that folder it says it can't find nmake.
When I move nmake into fcgi, it says it can't find cl.exe
Posted on 2006-05-15 13:59:36 by drhowarddrfine
Then probably it's something to do with environment variables.
It seems that you have changed them correctly. However if you did that trough "control panel->system properties->...." you will need to restart the command prompt to reflect the changes.
Also just in case type SET to check if everything is okay.

I have created a new account on my system and tried to compile fcgi-2.4.0. It compiled without any errors. (although I am using VC++ instead of VC Toolkit there should be any difference for your task). This is what SET shows about LIB, Path and INCLUDE variables:

INCLUDE=C:\Program Files\Microsoft Visual Studio\VC98\include
LIB=C:\Program Files\Microsoft Visual Studio\VC98\lib
Path=C:\WINDOWS.0\system32;C:\WINDOWS.0;C:\Program Files\Microsoft Visual Studio\VC98\bin

nmake was located in 'C:\Program Files\Microsoft Visual Studio\VC98\bin' and when compiling I followed instructions in my previous post.
Posted on 2006-05-15 14:41:36 by arafel
The problem was setting the environment.  With all the fiddling around I was doing I think I lost track of something but it's working now. 

Unfortunately, it needs some include files from the Platform SDK, such as windows.h, which I don't have.  I thought they would be in the toolkit.  I tried pointing it to PellesC include files but it has problems with that. 

If the compiled version of that lib isn't too big, can one of you guys email it to me?  I just don't feel like installing the SDK.
Posted on 2006-05-15 16:19:49 by drhowarddrfine
sorry I can't log into my email account at the moment.
the attached zip contains compiled lib and compiled example executables from the package.
Posted on 2006-05-15 16:32:43 by arafel
arafel,  thanks so much!  Saved me a lot of trouble.
Posted on 2006-05-15 17:23:52 by drhowarddrfine

If the compiled version of that lib isn't too big, can one of you guys email it to me?  I just don't feel like installing the SDK.

Understandable, considering how big a download and install you need just to get at a few files :|

I wish Microsoft had a somewhat more liberal (re)distribution policy... I've set up my own little personal-use package which includes vc2003 toolkit, latest platformsdk header+libs, and the last .CHM version of the platformsdk help. A lot smaller than all the downloads you need to get this, but of course I have to keep it to myself because of license issues :(
Posted on 2006-05-16 04:29:39 by f0dder