Nmake errors with BINDEXPLIB

Hi,

I am trying to compile a National Instruments code in VC++ and cygwin using nmake.

I downloaded CERN’s ROOT for Windows and it compiled just fine.

But because I wanted some other libraries I had to re-install Brookhaven’s ROOT for windows. Since then it has not compiled. Since I had some errors with the /usr/bin/link, I did mv /usr/bin/link.exe /usr/bin/link_cyg.exe as suggested in a ROOT forum. But now I am stuck with this error with the inability to make an .obj file and a fatal error related to BINDEXPLIB. Does anyone have any ideas?

Here’s the whole message copied:-

$ nmake -f makefile.mak

Microsoft ® Program Maintenance Utility Version 8.00.50727.42
Copyright © Microsoft Corporation. All rights reserved.

Deleting dictionary…
Could Not Find C:\cygwin\home\Sujeewa\TestCode\LeakTest\TLeakTestdict.h
Generating dictionary …
cl -D_MT -D_DLL -MDd -EHsc -nologo -G5 -GR -MD -DWIN32 -DVISUAL_CPLUS
PLUS -D_WINDOWS -IC:\ROOT/include -O2 -c TLeakTestdict.cpp
cl : Command line warning D9025 : overriding ‘/MDd’ with '/MD’
cl : Command line warning D9002 : ignoring unknown option '-G5’
TLeakTestdict.cpp
c:\cygwin\home\sujeewa\testcode\gotemp\GSkipCommExt.h(65) : warning C4068: unkno
wn pragma
c:\cygwin\home\sujeewa\testcode\gotemp\GSkipCommExt.h(224) : warning C4068: unkn
own pragma
c:\cygwin\home\sujeewa\testcode\gotemp\GSensorDDSMem.h(67) : warning C4068: unkn
own pragma
c:\cygwin\home\sujeewa\testcode\gotemp\GSensorDDSMem.h(114) : warning C4068: unk
nown pragma
TLeakTestdict.cpp(123) : warning C4996: ‘strcat’ was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(78) : see
declaration of 'strcat’
Message: 'This function or variable may be unsafe. Consider using strcat
_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online hel
p for details.'
TLeakTestdict.cpp(169) : warning C4996: ‘strcat’ was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(78) : see
declaration of 'strcat’
Message: 'This function or variable may be unsafe. Consider using strcat
_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online hel
p for details.'
TLeakTestdict.cpp(175) : warning C4996: ‘strcat’ was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(78) : see
declaration of 'strcat’
Message: 'This function or variable may be unsafe. Consider using strcat
_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online hel
p for details.'
Linking libLeakTest.dll …
BINDEXPLIB libLeakTest TLeakTest.obj TLeakTestdict.obj > libLeakTest.de
f
Unable to find ‘TLeakTest.obj’ for reading:
NMAKE : fatal error U1077: ‘BINDEXPLIB’ : return code '0x1’
Stop.

Hi,

Could you attach your makefile.mak, please ?

– Bertrand.

Hi Betrand,

Here is my makefile.mak

ObjSuf = obj
SrcSuf = cpp
ExeSuf = .exe
DllSuf = dll
OutPutOpt = -out:

Win32 system with Microsoft Visual C/C++

!include <win32.mak>
CC = $(cc)
CXX = $(cc)
CXXFLAGS = $(cvarsdll) -EHsc -nologo -G5 -GR -MD -DWIN32
-DVISUAL_CPLUSPLUS -D_WINDOWS -I$(ROOTSYS)/include
CXXOPT = -O2
#CXXOPT = -Z7
LD = $(link)
LDOPT = -opt:ref
#LDOPT = -debug
LDFLAGS = $(LDOPT) $(conlflags) -nologo
SOFLAGS = $(dlllflags:-pdb:none=)
ROOTLIBS = $(ROOTSYS)/lib/libCore.lib
$(ROOTSYS)/lib/libCint.lib $(ROOTSYS)/lib/libHist.lib
$(ROOTSYS)/lib/libGraf.lib $(ROOTSYS)/lib/libGraf3d.lib
$(ROOTSYS)/lib/libGpad.lib $(ROOTSYS)/lib/libTree.lib
$(ROOTSYS)/lib/libRint.lib $(ROOTSYS)/lib/libPostscript.lib
$(ROOTSYS)/lib/libMatrix.lib $(ROOTSYS)/lib/libPhysics.lib
$(ROOTSYS)/lib/libGui.lib
LIBS = $(ROOTLIBS) $(guilibsdll) MSVCPRT.LIB
…/GoTemp/libGoTemp.lib …/MeasCompDAQ/libMeasCompDAQ.lib
LIBSALL = $(ROOTLIBS)
LIBNAME = libLeakTest
PROGRAMLIB = $(LIBNAME).lib

HDRS = TLeakTest.h
SRCS = main.$(SrcSuf) TLeakTest.$(SrcSuf) TLeakTestdict.$(SrcSuf)
OBJS = TLeakTest.$(ObjSuf) TLeakTestdict.$(ObjSuf)

PROGRAM = LeakTest$(ExeSuf)
PROGRAMSO = $(LIBNAME).$(DllSuf)
all: $(PROGRAMSO) $(PROGRAM)

$(PROGRAMSO): $(OBJS)
@echo "Linking $(PROGRAMSO) …"
BINDEXPLIB $* $(OBJS) > $.def
lib -nologo -MACHINE:IX86 $(OBJS) -def:$
.def $(OutPutOpt)$(PROGRAMLIB)
$(LD) $(SOFLAGS) $(LDFLAGS) $(OBJS) $*.exp $(LIBS) $(OutPutOpt)$(PROGRAMSO)
@echo “$(PROGRAMSO) done”

$(PROGRAM): main.$(ObjSuf) $(OBJS)
@echo “Linking $(PROGRAM) …”
$(LD) $(LDFLAGS) main.$(ObjSuf) $(OBJS) $(LIBS) $(OutPutOpt)$(PROGRAM)
@echo “$(PROGRAM) done”

clean:
@del /q $(OBJS) main.$(ObjSuf) TLeakTestdict.h TLeakTestdict.$(SrcSuf)
@del /q $(PROGRAM) $(PROGRAMSO) $(PROGRAMLIB) $(LIBNAME).def $(LIBNAME).exp
@del /q Release*.obj Debug*.obj
@del /q $(ROOTDEV)\bin$(LIBNAME).$(DllSuf)
@del /q $(ROOTDEV)\lib$(LIBNAME).$(DllSuf)
@del /q $(ROOTDEV)\lib$(LIBNAME).lib
@del /q $(ROOTDEV)\lib$(LIBNAME).def
@del /q $(ROOTDEV)\lib$(LIBNAME).exp
@del /q $(ROOTDEV)\include\TLeakTest.h

install:
@del /q $(ROOTDEV)\bin$(LIBNAME).$(DllSuf)
@del /q $(ROOTDEV)\lib$(LIBNAME).$(DllSuf)
@del /q $(ROOTDEV)\lib$(LIBNAME).lib
@del /q $(ROOTDEV)\lib$(LIBNAME).def
@del /q $(ROOTDEV)\lib$(LIBNAME).exp
@del /q $(ROOTDEV)\include\TLeakTest.h
@copy $(LIBNAME).$(DllSuf) $(ROOTDEV)\bin$(LIBNAME).$(DllSuf)
@copy $(LIBNAME).$(DllSuf) $(ROOTDEV)\lib$(LIBNAME).$(DllSuf)
@copy $(LIBNAME).lib $(ROOTDEV)\lib$(LIBNAME).lib
@copy $(LIBNAME).def $(ROOTDEV)\lib$(LIBNAME).def
@copy $(LIBNAME).exp $(ROOTDEV)\lib$(LIBNAME).exp
@copy TLeakTest.h $(ROOTDEV)\include\TLeakTest.h
@echo “libraries, shared libraries and includes copied to $(ROOTDEV)”

TLeakTest.$(ObjSuf): TLeakTest.h

TLeakTestdict.cpp: $(HDRS)
@echo “Deleting dictionary…”
@del /q TLeakTestdict.h TLeakTestdict.cpp TLeakTestdict.obj
@echo “Generating dictionary …”
@$(ROOTSYS)\bin\rootcint -f TLeakTestdict.$(SrcSuf) -c $(HDRS) LinkDef.h

.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) $(CXXOPT) -c $<

Thanks!

  • Sujeewa

Hi,

I don’t see any obvious problem with the makefile…
Could you post your full source code and makefile in a tar file?

Bertrand.

  1. You are using the Cygwin bash shell command window aren’t you?
    Why? Can you use the regular Windows “Command Prompt” ?

  2. If you use Cygwin, please, tell us how you start the Cygwin session.

  3. Can you print the Windows environment with the command

 and send the output.

Thank you

[quote=“sujeewa”]I had to re-install Brookhaven’s ROOT for windows. Since then it has not compiled. [/quote]Can you say which ROOT version from BNL you installed? Did you install it into the separate dedicated directory? It would be nice to see your entire project to reproduce your trouble.