www.digitalmars.com         C & C++   DMDScript  

c++ - Linking ?

reply Jean-Pierre H. Dumas <dumas.jeanpierre free.fr> writes:
I do not understand why optlink is issuing an error.
(To remove the # before KERNEL32.LIB in the makefile
change nothing.)

The IDDE generated makefile to make the .LIB contains:
+++++++++++++++++++++++++++++++++++++
CFLAGS		=  -Ju -mn -o+time -D_WINDOWS -ff -NL -ND -3 -a8 -Nc -c 
LFLAGS		=  /M /NOI /DO /DE /PACKF /XN /A:512
DEFINES		= -DNDEBUG -D_WIN32_WINNT=0x0400 -DENABLE_WINDIB -DENABLE_DIRECTX
!ENDIF

HFLAGS		= $(CFLAGS) 
MFLAGS		= MASTERPROJ=$(PROJ) 
LIBFLAGS	=  /C /NOI /P:64 
+++++++++++++++++++++++++++++++++++++

What am I doing wrong ?

Help.

Jean-Pierre Dumas
===================================
C:\TEMP\SDL-1.2\test>smake

SMAKE  Program Maintenance Utility (Console) Version 7.50
Copyright (c) 1994-1995 Innovative Data Concepts Incorporated
Copyright (c) 1994-2001 Digital Mars
All Rights Reserved

        sc -Ju -mn -o+time -WA -ff -ND -5 -a4 -Nc  -DNDEBUG -DWIN32 -D_WINDOWS -
D_WIN32_WINNT=0x0400  -DENABLE_WINDIB -DENABLE_DIRECTX -DHAVE_OPENGL -I..\includ
e -c ..\src\main\win32\SDL_main.c
        sc -Ju -mn -o+time -WA -ff -ND -5 -a4 -Nc  -DNDEBUG -DWIN32 -D_WINDOWS -
D_WIN32_WINNT=0x0400  -DENABLE_WINDIB -DENABLE_DIRECTX -DHAVE_OPENGL -I..\includ
e -c checkkeys
        link /NOI /PACKF /DE /XN /NT /ENTRY:WinMainCRTStartup  /BAS:4194304 /A:5
12 c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB SDL_main.obj checkkeys.obj, checkke
ys.exe,,c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

kernel32.lib
 Error 43: Not a Valid Library File
SMAKE fatal error: command "link" returned with error code 1
Stopping.

C:\TEMP\SDL-1.2\test>
=====================================
The makefile begin with :
=====================================
INCLUDE=..\include

CC=sc

CFLG=-Ju -mn -o+time -WA -ff -ND -5 -a4 -Nc \
 -DNDEBUG -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0400 \
 -DENABLE_WINDIB -DENABLE_DIRECTX -DHAVE_OPENGL -I$(INCLUDE)

LIB=k:\dm\lib\ 

LNK=link

LFLAGS=/NOI /PACKF /DE /XN /NT /ENTRY:WinMainCRTStartup \
 /BAS:4194304 /A:512 c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB

LIBZ=c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB # KERNEL32.LIB GDI32.LIB
USER32.LIB

all :SDL_main.obj checkkeys.exe graywin.exe loopwave.exe testalpha.exe \
testbitmap.exe testcdrom.exe testerror.exe testgamma.exe testgl.exe \
testhread.exe testjoystick.exe testkeys.exe testlock.exe \
testpalette.exe testsem.exe testsprite.exe testtimer.exe \
testtypes.exe testver.exe testvidinfo.exe testwin.exe \
testwm.exe threadwin.exe torturethread.exe 

clean:
	-rm *.exe *.obj *.map *.dep *.err

SDL_main.obj : ..\src\main\win32\SDL_main.c makefile
	$(CC) $(CFLG) -c ..\src\main\win32\SDL_main.c
	
checkkeys.exe : checkkeys.c SDL_main.obj makefile
	$(CC) $(CFLG) -c $*
	$(LNK) $(LFLAGS) SDL_main.obj $*.obj, $*.exe,,$(LIBZ)

graywin.exe : graywin.c SDL_main.obj makefile
	$(CC) $(CFLG) -c $*
	$(LNK) $(LFLAGS) SDL_main.obj $*.obj, $*.exe,,$(LIBZ)

loopwave.exe : loopwave.c SDL_main.obj makefile
	$(CC) $(CFLG) -c $*
	$(LNK) $(LFLAGS) SDL_main.obj $*.obj, $*.exe,,$(LIBZ)
..
Jan 28 2002
parent Jan Knepper <jan smartsoft.cc> writes:
I think there is something wrong with your KERNEL32.LIB!
Try to find:
1.    If there is an other KERNEL32.LIB on your system that might be picked up
BEFORE
the KERNEL32.LIB in your LIB directory.
2.    Compare KERNEL32.LIB with the original CD. I suspect it might be
overwritten.

Jan



"Jean-Pierre H. Dumas" wrote:

 I do not understand why optlink is issuing an error.
 (To remove the # before KERNEL32.LIB in the makefile
 change nothing.)

 The IDDE generated makefile to make the .LIB contains:
 +++++++++++++++++++++++++++++++++++++
 CFLAGS          =  -Ju -mn -o+time -D_WINDOWS -ff -NL -ND -3 -a8 -Nc -c
 LFLAGS          =  /M /NOI /DO /DE /PACKF /XN /A:512
 DEFINES         = -DNDEBUG -D_WIN32_WINNT=0x0400 -DENABLE_WINDIB
-DENABLE_DIRECTX
 !ENDIF

 HFLAGS          = $(CFLAGS)
 MFLAGS          = MASTERPROJ=$(PROJ)
 LIBFLAGS        =  /C /NOI /P:64
 +++++++++++++++++++++++++++++++++++++

 What am I doing wrong ?

 Help.

 Jean-Pierre Dumas
 ===================================
 C:\TEMP\SDL-1.2\test>smake

 SMAKE  Program Maintenance Utility (Console) Version 7.50
 Copyright (c) 1994-1995 Innovative Data Concepts Incorporated
 Copyright (c) 1994-2001 Digital Mars
 All Rights Reserved

         sc -Ju -mn -o+time -WA -ff -ND -5 -a4 -Nc  -DNDEBUG -DWIN32 -D_WINDOWS
-
 D_WIN32_WINNT=0x0400  -DENABLE_WINDIB -DENABLE_DIRECTX -DHAVE_OPENGL
-I..\includ
 e -c ..\src\main\win32\SDL_main.c
         sc -Ju -mn -o+time -WA -ff -ND -5 -a4 -Nc  -DNDEBUG -DWIN32 -D_WINDOWS
-
 D_WIN32_WINNT=0x0400  -DENABLE_WINDIB -DENABLE_DIRECTX -DHAVE_OPENGL
-I..\includ
 e -c checkkeys
         link /NOI /PACKF /DE /XN /NT /ENTRY:WinMainCRTStartup  /BAS:4194304
/A:5
 12 c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB SDL_main.obj checkkeys.obj,
checkke
 ys.exe,,c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 kernel32.lib
  Error 43: Not a Valid Library File
 SMAKE fatal error: command "link" returned with error code 1
 Stopping.

 C:\TEMP\SDL-1.2\test>
 =====================================
 The makefile begin with :
 =====================================
 INCLUDE=..\include

 CC=sc

 CFLG=-Ju -mn -o+time -WA -ff -ND -5 -a4 -Nc \
  -DNDEBUG -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0400 \
  -DENABLE_WINDIB -DENABLE_DIRECTX -DHAVE_OPENGL -I$(INCLUDE)

 LIB=k:\dm\lib\

 LNK=link

 LFLAGS=/NOI /PACKF /DE /XN /NT /ENTRY:WinMainCRTStartup \
  /BAS:4194304 /A:512 c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB

 LIBZ=c:\temp\sdl-1.2\dm_idde\release\sdl12.LIB # KERNEL32.LIB GDI32.LIB
USER32.LIB

 all :SDL_main.obj checkkeys.exe graywin.exe loopwave.exe testalpha.exe \
 testbitmap.exe testcdrom.exe testerror.exe testgamma.exe testgl.exe \
 testhread.exe testjoystick.exe testkeys.exe testlock.exe \
 testpalette.exe testsem.exe testsprite.exe testtimer.exe \
 testtypes.exe testver.exe testvidinfo.exe testwin.exe \
 testwm.exe threadwin.exe torturethread.exe

 clean:
         -rm *.exe *.obj *.map *.dep *.err

 SDL_main.obj : ..\src\main\win32\SDL_main.c makefile
         $(CC) $(CFLG) -c ..\src\main\win32\SDL_main.c

 checkkeys.exe : checkkeys.c SDL_main.obj makefile
         $(CC) $(CFLG) -c $*
         $(LNK) $(LFLAGS) SDL_main.obj $*.obj, $*.exe,,$(LIBZ)

 graywin.exe : graywin.c SDL_main.obj makefile
         $(CC) $(CFLG) -c $*
         $(LNK) $(LFLAGS) SDL_main.obj $*.obj, $*.exe,,$(LIBZ)

 loopwave.exe : loopwave.c SDL_main.obj makefile
         $(CC) $(CFLG) -c $*
         $(LNK) $(LFLAGS) SDL_main.obj $*.obj, $*.exe,,$(LIBZ)
 ..

Jan 28 2002