Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link Problem -

Status
Not open for further replies.

foodman

Programmer
Feb 28, 2000
5
0
0
US
My main machine died today.

For more than a year now, I have been running all my stuff directly from
a memory stick (Drive F:) Everything I need is on the memory stick,
the compiler, SP2, source code, everything is on the stick.

Drive C: is devoted to Windows (Vista) and other nonessential software.

For backup purposes, I keep a laptop.

So, no problem, the main PC is dead but I have my laptop.

So, I stick my memory stick into the laptop and compile a program.

The compiler runs, and produces an OBJ.

The Link step runs, produces no messages but produces NO DLL.

I tried linking to produce an EXE and Link does not produce an EXE either
but gives no error messages.

In both cases, no error messages are given by Link.

I have a second memory stick which I use for backup.

I stick in the second memory stick in a different USB port.

Same thing - the compiler produces an OBJ but Link does not produce a DLL.

I have a third device, a USB hard drive. I stick that in and again
no DLL is produced.

I have a duplicate directory of all my stuff on drive C:

Again, compiling on C:, no DLL or EXE is produced via Link and no messages
are given.

Normally, Link identifies itself as "Microsoft Segmented Executable Linker"
or words to that effect, but the execution of Link described above does not
produce that message. No messages of any kind are produced.

So, perhaps there is another program called Link which is being executed.
I search the entire machine for 'LINK' and the only ones found are the correct
versions of Link.exe.

I changed the Path to just the directory containing my stuff and put the
compiler in that directory too. Made no difference.

No matter how I execute Link on four different devices it never works.


????

Thanks

Tony Dilworth





 
And what is the relationship of your problem to COBOL?
 
I am compiling and attempting to link a COBOL program.
 
microsoft v 5.0 16-bit (micro-focus)
 
What OS was on your main maschine, where you compiled before? Windows XP or Vista?

As I can remember the Microsoft COBOL compiler V5 was designed to run on Windows 3.1. I tried it on Windows XP too and it worked, but I never tried it on Vista.

If you are running your stick with the Microsoft COBOL compiler on the notebook with Vista, it could be the compatibility issue or issue with rights (as with other old software).

Try this:

* compile on command line (not from IDE) to see if windows outputs some messages.

* Right click on your Compiler's executable or on the desktop shortcut and from properties select the compatibility table. Try to set the compatibility mode e.g. to Windows 95

* Right click on your Compiler's executable or on the desktop shortcut and select 'Run as Administrator'.
 
I always compile and link on the command line.
Since I have no DLL I cannot run in compatibility mode or any other!
I have UAC turned off and am the administrator.
Remember that it does compile, just does not link.

thanks for the suggestions.

This software has worked on every version of Windows through Vista. Vista on old PC and laptop.
 
I have a Windows XP machine and a Windows Vista machine and I looked at the problem with the old Microsoft COBOL compiler:

I copied the directory with MS COBOL at USB stick which I use on the both machines (Windows XP and Windows Vista) as drive I: then I created a bat file for setting the compiler environment
msenv.bat
Code:
REM Enviroment Variables for MS COBOL
SET PATH=I:\MSCOBOL\BIN;%path%         
SET COBDIR=I:\MSCOBOL\BIN;
SET LIB=I:\MSCOBOL\LIB;
SET INCLUDE=I:\MSCOBOL\SOURCE;
SET HELPFILES=I:\MSCOBOL\HELP;
SET INIT=I:\MSCOBOL\INIT;

Now I tried to compile the same project on both machines - i.e. this make file
arith.mak
Code:
ORIGIN = PWB
ORIGIN_VER = 2.1.49
PROJ = ARITH
PROJFILE = ARITH.MAK
DEBUG = 0

COBOL  = cobol
ANIMATE  = animate
LLIBS_R  = /NOD COBLIB COBAPI
LLIBS_D  = /NOD COBLIB COBAPI
LFLAGS_G  = /BATCH
COBFLAGS_G  = EDITOR"MS" NOQUERY
COBFLAGS_D  = ANIM OPT"0"
COB_BUILD_TYPE	= 2,0
XB  = XB
LINKER	= link
LRF  = echo > NUL

FILES  = ARITH.CBL ..\LIB\ADIS.OBJ ..\LIB\ADISKEY.OBJ ..\LIB\ADISINIT.OBJ
OBJS_EXT  = ..\LIB\ADIS.OBJ ..\LIB\ADISKEY.OBJ ..\LIB\ADISINIT.OBJ
OBJS  = ARITH.obj $(OBJS_EXT)

all: $(PROJ).exe

.SUFFIXES:
.SUFFIXES:
.SUFFIXES: .obj .cbl

ARITH.obj : ARITH.CBL
!IF $(DEBUG)
	echo $(COBFLAGS_G) $(COBFLAGS_D) > $(PROJ).DIR
!ELSE
	echo $(COBFLAGS_G) $(COBFLAGS_R) > $(PROJ).DIR
!ENDIF
!IF $(DEBUG)
	$(COBOL) ARITH.CBL, ARITH.obj DIRECTIVES($(PROJ).DIR);
!ELSE
	$(COBOL) ARITH.CBL, ARITH.obj DIRECTIVES($(PROJ).DIR);
!ENDIF


$(PROJ).exe : $(OBJS)
!IF $(DEBUG)
	$(LRF) @<<$(PROJ).lrf
 $(OBJS: = +^
) $(COBOBJ_D) 
$@
$(MAPFILE_D)
$(LLIBS_G: = +^
) +
$(LLIBS_D: = +^
) +
$(LIBS: = +^
)
$(DEF_FILE) $(LFLAGS_G) $(LFLAGS_D);
<<
!ELSE
	$(LRF) @<<$(PROJ).lrf
 $(OBJS: = +^
) $(COBOBJ_R) 
$@
$(MAPFILE_R)
$(LLIBS_G: = +^
) +
$(LLIBS_R: = +^
) +
$(LIBS: = +^
)
$(DEF_FILE) $(LFLAGS_G) $(LFLAGS_R);
<<
!ENDIF
	$(LINKER) @$(PROJ).lrf
	XB $@ $@


.cbl.obj :
!IF $(DEBUG)
	echo $(COBFLAGS_G) $(COBFLAGS_D) > $(PROJ).DIR
!ELSE
	echo $(COBFLAGS_G) $(COBFLAGS_R) > $(PROJ).DIR
!ENDIF
!IF $(DEBUG)
	$(COBOL) $<, $@ DIRECTIVES($(PROJ).DIR);
!ELSE
	$(COBOL) $<, $@ DIRECTIVES($(PROJ).DIR);
!ENDIF


run: $(PROJ).exe
	$(PROJ).exe $(RUNFLAGS)

debug: $(PROJ).exe
	$(ANIMATE) $(PROJ).exe $(ANIMFLAGS) END $(RUNFLAGS)

On Windows XP
After setting the environment with msenv.bat I runned this command
Code:
I:\MSCOBOL\Projekt>nmake /a /f i:\mscobol\projekt\arith.mak all

Microsoft (R) Program Maintenance Utility   Version 1.20
Copyright (c) Microsoft Corp 1988-92. All rights reserved.

        echo EDITOR"MS" NOQUERY  > ARITH.DIR
        cobol ARITH.CBL, ARITH.obj DIRECTIVES(ARITH.DIR);

Microsoft (R) Segmented Executable Linker  Version 5.31.009 Jul 13 1992
Copyright (C) Microsoft Corp 1984-1992.  All rights reserved.

Object Modules [.obj]: ARITH.obj +
Object Modules [.obj]: ..\LIB\ADIS.OBJ +
Object Modules [.obj]: ..\LIB\ADISKEY.OBJ +
Object Modules [.obj]: ..\LIB\ADISINIT.OBJ
Run File [ARITH.exe]: ARITH.exe
List File [nul.map]:
Libraries [.lib]:  +
Libraries [.lib]: /NOD +
Libraries [.lib]: COBLIB +
Libraries [.lib]: COBAPI +
Libraries [.lib]:
Definitions File [nul.def]:  /BATCH ;
        XB ARITH.exe ARITH.exe
When the line with compiler command was processed
Code:
cobol ARITH.CBL, ARITH.obj DIRECTIVES(ARITH.DIR);
it was opened a separate command window with MS COBOL compiler:
Code:
Microsoft (R) COBOL Optimizing Compiler Version 5.0
...
... 
*Checking complete with no errors - starting code generation
* Data = 000000596 Code = 000002588
and then came out a popup with Application terminated.
I clicked at OK, and processing the make file continued with linker as you see above.

On Windows Vista
The processing was the same: after setting the environment with msenv.bat I runned this command
Code:
I:\MSCOBOL\Projekt>nmake /a /f i:\mscobol\projekt\arith.mak all

Microsoft (R) Program Maintenance Utility   Version 1.20
Copyright (c) Microsoft Corp 1988-92. All rights reserved.

        echo EDITOR"MS" NOQUERY  > ARITH.DIR
        cobol ARITH.CBL, ARITH.obj DIRECTIVES(ARITH.DIR);

I:\MSCOBOL\Projekt>
After the line with compiler
Code:
cobol ARITH.CBL, ARITH.obj DIRECTIVES(ARITH.DIR);
it was opened the same separate command line window with MS COBOL Compiler
Code:
Microsoft (R) COBOL Optimizing Compiler Version 5.0
...
... 
*Checking complete with no errors - starting code generation
* Data = 000000596 Code = 000002588
and the same popup with Application terminated came out.
But when I clicked at OK, the processing of the make file was stopped! So the linking was not done!
Hovewer the ARITH.OBJ was created.

This is the difference running MS COBOL on Windows XP and Vista.
 
The linker is in the bin subdirectory.

If I call the linker in Windows XP it runs and wants an input
Code:
I:\MSCOBOL\BIN>link

Microsoft (R) Segmented Executable Linker  Version 5.31.009 Jul 13 1992
Copyright (C) Microsoft Corp 1984-1992.  All rights reserved.

Object Modules [.obj]:

But if try to call the linker in Vista nothing happens
Code:
I:\MSCOBOL\BIN>link
I:\MSCOBOL\BIN>

In Vista the linker delivered with MS COBOL is not working !
 
I got the linker running on Windows Vista amd the EXE was created.
I used DOSBox which I have installed on Windows Vista for runnig old games.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top