[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1196
  • Last Modified:

Path issues when compiling my DLL

I am trying to compile my DLL from command line utility nmake. I am running Visual C++ 6.0 Enterprise edition. The path to  "C:\Program Files\Microsoft Visual Studio\VC98\Include" is available in my classpath environment variable and bin also is present in Path variable. However when i run namake it says it didnt find cl.exe. I had to go through the process of copying over these files to my project folder which included c1.exe, stdio.h, windows.h etc etc..

Why would the compiler not pick these files as the location has already been added?
Any help will be greatly appreciated.

Thanks.
0
rupvis
Asked:
rupvis
  • 4
  • 2
3 Solutions
 
doraemon2555Commented:
try to check the "include" variable by running:
nmake /p

otherwise dump in a file and let's read it out...
0
 
DanRollinsCommented:
There is a batch file that sets up the environment so that nMake (and other utilities such as Lib) will work from the command line even when the current directory is your project directory.  Look for a file named:
    VCVARS32.BAT
it's in your VC98\Bin directory.  Get to a command line and run that.  Then CD to your project directory and nMake (et. al) should work.
Incidently, one rarely if ever uses nmake these days.   Just use the IDE to build the project.
0
 
rupvisAuthor Commented:
Thank you so much DanRollins for your response.. i did run the batchfile and ran nmake for the project directory to get the following result..

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -
D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32  -D_WIN32 -Z7 -O
d hooks32.c
'cl' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'cl' : return code '0x1'
Stop.

Looks like it cant find cl.exe again. DO i need to start copying cl.exe to the src directory again?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rupvisAuthor Commented:
out put from nmake /p doeramon255

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.


MACROS:

      cvarsmt = $(cvars) -D_MT -MT
PROCESSOR_IDENTIFIER = x86 Family 6 Model 15 Stepping 11, GenuineIntel
      INCLUDE = C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\incl
ude\
      psxlibs = libcpsx.lib psxdll.lib psxrtl.lib oldnames.lib
      COMSPEC = C:\WINDOWS\system32\cmd.exe
        scall = -Gz
      psxvars = -D_POSIX_
   _NMAKE_VER = 7.10.3077
     ole2libs = $(olelibs)
      PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
         MAKE = nmake
        cvars = -DWIN32 $(noansi) -D_WIN32
   olelibsdll = ole32.lib uuid.lib oleaut32.lib $(guilibsdll)
   conlibsdll = $(libcdll) $(baselibs)
   SYSTEMROOT = C:\WINDOWS
   guilibsdll = $(libcdll) $(winlibs)
         PATH = C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Progr
am Files\Java\jdk1.5.0_14\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BIN
N;C:\apache-ant-1.7.0\bin;C:\Program Files\Java\jdk1.5.0_14\bin;C:\Program Files
\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\To
ols\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Mi
crosoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
 Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\ASG\ASGUMA\ROCHADE\bin;C:\PRO
GRA~1\ATT\Graphviz\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Mic
rosoft Visual Studio .NET 2003\SDK\v1.1\Bin;C:\WINDOWS\Microsoft.NET\Framework\v
2.0.50727;D:\Downloads\ASG Downloads\glassfish\bin;C:\instantclient-basic-win32-
10.2.0.4\instantclient_10_2;C:\Program Files\Microsoft Visual Studio\VC98\Includ
e;
NUMBER_OF_PROCESSORS = 2
         TEMP = C:\DOCUME~1\rupeshv\LOCALS~1\Temp
   cvarsmtdll = $(cvarsmt) -D_DLL
     baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib
  SESSIONNAME = Console
  _WIN32_MAK_ = 1
     conflags = $(conlflags)
  USERPROFILE = C:\Documents and Settings\rupeshv
     guiflags = $(guilflags)
COMMONPROGRAMFILES = C:\Program Files\Common Files
  LOGONSERVER = \\MASING3DC1
     HOMEPATH = \Documents and Settings\rupeshv
  ole2libsdll = $(olelibsdll)
     cvarsdll = $(cvars) -D_MT -D_DLL -MD
__COMPAT_LAYER = EnableNXShowUI
  SYSTEMDRIVE = C:
     USERNAME = rupeshv
     psxflags = $(psxlflags)
     TARGETOS = WINNT
       cdebug = -Z7 -Od
     ANT_HOME = C:\apache-ant-1.7.0
     DLLENTRY = @12
        COBOL = cobol
       cflags = $(cflags) -D_WIN32_IE=$(_WIN32_IE) -DWINVER=$(NMAKE_WINVER)
                $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER)
                $(ccommon) -D_X86_=1
       ldebug = -debug:full -debugtype:cv
       lflags = /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO
       libcmt = libcmt.lib oldnames.lib
ALLUSERSPROFILE = C:\Documents and Settings\All Users
       implib = lib
 VSEDEFLOGDIR = C:\Documents and Settings\All Users\Application Data\McAfee\Desk
topProtection
           BC = bc
           CC = cl
       cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
 PROGRAMFILES = C:\Program Files
    MAKEFLAGS = P
PROCESSOR_REVISION = 0f0b
    DEFLOGDIR = C:\Documents and Settings\All Users\Application Data\McAfee\Desk
topProtection
 COMPUTERNAME = MASINGXRUPESH
       rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) $(noansi)
           AS = ml
           RC = rc
       cvtres = REM !!! CVTRES is no longer necessary - please remove !!!
PROCESSOR_LEVEL = 6
         libc = libc.lib oldnames.lib
    _WIN32_IE = 0x0300
PROCESSOR_ARCHITECTURE = x86
           OS = Windows_NT
    HOMEDRIVE = C:
    CLASSPATH = .;C:\Program Files\Java\jdk1.5.0_14\jre\lib\mail.jar;C:\Program
Files\Java\jdk1.5.0_14\jre\lib\dsn.jar;C:\Program Files\Java\jdk1.5.0_14\jre\lib
\imap.jar;C:\Program Files\Java\jdk1.5.0_14\jre\lib\mailapi.jar;C:\Program Files
\Java\jdk1.5.0_14\jre\lib\pop3.jar;C:\Program Files\Java\jdk1.5.0_14\jre\lib\smt
p.jar;C:\Program Files\Java\jdk1.5.0_14\jre\lib\activation.jar;C:\Program Files\
Java\jre1.6.0_06\lib\ext\QTJava.zip;E:\Fit\lib\OpenForecast-0.4.0.jar;C:\Turnkey
\tomcat\lib\jtds-1.2.jar;C:\ASG\ASGUMA\bin\lax.jar;C:\ASG\ASGUMA\bin\service.jar
;C:\ASG\ASGUMA\bin\umaadapters.jar;C:\ASG\ASGUMA\bin\umacomms.jar;C:\ASG\ASGUMA\
bin\umacomponents.jar;C:\ASG\ASGUMA\bin\umadataflow.jar;C:\ASG\ASGUMA\bin\umadat
aobjects.jar;C:\ASG\ASGUMA\bin\umademo.jar;C:\ASG\ASGUMA\bin\umadesigner.jar;C:\
ASG\ASGUMA\bin\umafaces.jar;C:\ASG\ASGUMA\bin\umafederation.jar;C:\ASG\ASGUMA\bi
n\umainstall.jar;C:\ASG\ASGUMA\bin\umaitemdata.jar;C:\ASG\ASGUMA\bin\umaprocesso
rs.jar;C:\ASG\ASGUMA\bin\umarepository.jar;C:\ASG\ASGUMA\bin\umaresources.jar;C:
\ASG\ASGUMA\bin\umarunner.jar;C:\ASG\ASGUMA\bin\umasecurity.jar;C:\ASG\ASGUMA\bi
n\umaservice.jar;C:\ASG\ASGUMA\bin\umaui.jar;C:\ASG\ASGUMA\bin\umautil.jar;C:\AS
G\ASGUMA\bin\umawebservice.jar;C:\Program Files\Microsoft Visual Studio\VC98\Inc
lude;C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\ASG\ASGUMA\bin\umawidg
et.jar;
 NMAKE_WINVER = 0x0400
  winsocklibs = ws2_32.lib mswsock.lib
    JAVA_HOME = C:\Program Files\Java\jdk1.5.0_14
         link = link
       PASCAL = pl
    dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
    linkdebug = $(ldebug)
    conlflags = $(lflags) -subsystem:console,$(APPVER)
    TNS_ADMIN = C:\instantclient-basic-win32-10.2.0.4\instantclient_10_2
    guilflags = $(lflags) -subsystem:windows,$(APPVER)
    savlflags = $(lflags) -subsystem:windows,$(APPVER) -entry:WinMainCRTStartup
           cc = cl
       QTJAVA = C:\Program Files\Java\jre1.6.0_06\lib\ext\QTJava.zip
    olelibsmt = ole32.lib uuid.lib oleaut32.lib $(guilibsmt)
    conlibsmt = $(libcmt) $(baselibs)
           hc = hcrtf -xn
       WINDIR = C:\WINDOWS
       APPVER = 4.0
VS80COMNTOOLS = C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
VS71COMNTOOLS = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
\
    guilibsmt = $(libcmt) $(winlibs)
    psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
           rc = rc
      libcdll = msvcrt.lib oldnames.lib
          LIB = C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\
;C:\Program Files\SQLXML 4.0\bin\
USERDNSDOMAIN = asg.com
   CLIENTNAME = Console
      rcflags = /r
       PROMPT = $P$G
          CPP = cl
          FOR = fl32
          CPU = i386
                $(PROCESSOR_ARCHITECTURE)
      olelibs = ole32.lib uuid.lib oleaut32.lib $(guilibs)
      conlibs = $(libc) $(baselibs)
      ccommon = -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
FP_NO_HOST_CHECK = NO
      guilibs = $(libc) $(winlibs)
          TMP = C:\DOCUME~1\rupeshv\LOCALS~1\Temp
          CXX = cl
   ORACLE_SID = 10.30.0.95
   USERDOMAIN = ASG
      winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
      APPDATA = C:\Documents and Settings\rupeshv\Application Data
   ole2libsmt = $(olelibsmt)
      optlibs =
      MAKEDIR = E:\hook\hk\E2EHook\hook


INFERENCE RULES:

.asm.exe:
        commands:       $(AS) $(AFLAGS) $*.asm

.asm.obj:
        commands:       $(AS) $(AFLAGS) /c $*.asm

.c.exe:
        commands:       $(CC) $(CFLAGS) $<

.c.obj:
        commands:       $(CC) $(CFLAGS) /c $<

.cpp.exe:
        commands:       $(CPP) $(CPPFLAGS) $<

.cpp.obj:
        commands:       $(CPP) $(CPPFLAGS) /c $<

.cxx.exe:
        commands:       $(CXX) $(CXXFLAGS) $<

.cxx.obj:
        commands:       $(CXX) $(CXXFLAGS) /c $<

.bas.obj:
        commands:       $(BC) $(BFLAGS) $*.bas;

.cbl.exe:
        commands:       $(COBOL) $(COBFLAGS) $*.cbl, $*.exe;

.cbl.obj:
        commands:       $(COBOL) $(COBFLAGS) $*.cbl;

.f.exe:
        commands:       $(FOR) $(FFLAGS) $*.f

.f.obj:
        commands:       $(FOR) /c $(FFLAGS) $*.f

.f90.exe:
        commands:       $(FOR) $(FFLAGS) $*.f90

.f90.obj:
        commands:       $(FOR) /c $(FFLAGS) $*.f90

.for.exe:
        commands:       $(FOR) $(FFLAGS) $*.for

.for.obj:
        commands:       $(FOR) /c $(FFLAGS) $*.for

.pas.exe:
        commands:       $(PASCAL) $(PFLAGS) $*.pas

.pas.obj:
        commands:       $(PASCAL) /c $(PFLAGS) $*.pas

.rc.res:
        commands:       $(RC) $(RFLAGS) /r $*

.SUFFIXES: .exe .obj .asm .c .cpp .cxx .bas .cbl .f .f90 .for .pas .res .rc

TARGETS:

hooks32.res:
        flags:
        dependents:     hooks32.rc hooks32.h
        commands:       $(rc) $(rcvars) -r hooks32.rc

hooks32.exp:
        flags:
        dependents:     hooks32.obj hooks32.def
        commands:          $(implib) -machine:$(CPU)      -def:hooks32.def
         hooks32.obj ptdlgs.obj ptprint.obj ptfind.obj hooksdll.obj      -out:ho
oks32.lib

all:
        flags:
        dependents:     hooks32.exe hooksdll.dll
        commands:

hooksdll.lib:
        flags:
        dependents:     hooksdll.obj hooksdll.def hooksdll.rbj
        commands:          $(implib) -machine:$(CPU)      -def:hooksdll.def
         hooksdll.obj    -out:hooksdll.lib

hooksdll.obj:
        flags:
        dependents:     hooksdll.c hooks32.h
        commands:       $(cc) $(cflags) $(cvars) $(cdebug) hooksdll.c

hooksdll.dll:
        flags:
        dependents:     hooksdll.obj hooksdll.def hooksdll.lib
        commands:          $(link) $(linkdebug) MSVCRT.LIB /NODEFAULTLIB   -base
:0x1C000000   -dll             -entry:LibMain$(DLLENTRY)         -out:hooksdll.d
ll       hooksdll.exp hooksdll.obj hooksdll.rbj  $(guilibsdll)

hooksdll.rbj:
        flags:
        dependents:     hooksdll.res
        commands:       cvtres -$(CPU) hooksdll.res -o hooksdll.rbj

hooks32.obj:
        flags:
        dependents:     hooks32.c hooks32.h
        commands:       $(cc) $(cflags) $(cvars) $(cdebug) hooks32.c

hooks32.rbj:
        flags:
        dependents:     hooks32.res
        commands:       cvtres -$(CPU) hooks32.res -o hooks32.rbj

hooksdll.res:
        flags:
        dependents:     hooksdll.rc
        commands:       $(rc) $(rcvars) -r hooksdll.rc

hooks32.exe:
        flags:
        dependents:     hooks32.obj hooksdll.dll hooksdll.lib hooks32.rbj
                        hooks32.def
        commands:       $(link) $(linkdebug) MSVCRT.LIB  $(guiflags)   -out:hook
s32.exe  /ENTRY:mainCRTStartup  hooks32.obj hooksdll.lib hooks32.rbj  $(guilibs)



        cl -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -
D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32  -D_WIN32 -Z7 -O
d hooks32.c
NMAKE : fatal error U1077: 'cl' : return code '0xc0000135'
Stop.
0
 
DanRollinsCommented:
The batch file should have set your path so that CLExe will run. After running the batch file, your PATH should include (something like):
C:\Program Files\Microsoft Visual Studio\VC98\bin;
In any case, while in the directory with the make file, run the command
  CL
If it says "is not recognized as an internal or ... blah blah" then your PATH has not been set correctly
0
 
rupvisAuthor Commented:
After running the batch file i did run CL. The error i receive states
"This application has failed to start because mspdb60.dll was bit found.Re-installing the application might fix the problem "

A search in visual studio folder did not have mspdb60.dll...
0
 
rupvisAuthor Commented:
Thanks Danrollin.. Looks like i was missing a dll in my installed directory . Placing the dll "mspdb60.dll" within lib resolved the issue.

0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now