This command has always worked for me. It is a .bat file of one line.
%1 is the file to compile and link. After upgrading to 1.9 it fails
with linking error E3033.
What is happening here?
jw
Did you update jwlib.lib to the new OW 1.9 compiler ?
Lynn
No. Why do I need to do that? I never needed to do it before.
I even forget how to do it.
I would update jwlib.lib before trying anything else.
BTW, I link my 6 Win32 EXE files and 3 Win32 DLLs using OW 1.9
every day. I rebuild my local lib files as a part of my makeall.bat
script. These are DLLs with thousands of object files and many
libraries.
Lynn
I haven't done that in such a long time that I forget how I did it.
I accidentally discovered the command above and, since it worked,
never ventured any further. Can you post an extract from your
makeall.bat file that might save me some time from RTFM?
Do you mean the wlib command ? Here are my wlink and wlib commands:
del designii.dll
wlink @diid.lnk
del designii.lib
wlib designii +designii.dll
Lynn
I think it needs to be dumbed down a bit further for me.
If I recall correctly, I started with a few dozen *.for files,
then compiled them to get a bunch of *.obj files, which I then
added to a .lib file. Do I have to back up this far? I have never
used a .dll because I have never used C or C++.
> If I recall correctly, I started with a few dozen *.for files,
> then compiled them to get a bunch of *.obj files, which I then
> added to a .lib file. Do I have to back up this far? I have never
> used a .dll because I have never used C or C++.
If this is a library of your own (as I presume from the name and your
posting initials it must be) then I'd think it reasonably likely you
would know what's in it?
Indeedy do, if as Lynn is indicating the updates to OW introduced some
possibility of binary incompatibility w/ previous object files then
that's what you'll need to do.
If you haven't rebuilt the library for so long you don't recall what all
is in it then you can get a listing of the entry points in the library with
wlib -l=outputname yourlibname
or by default to the terminal simply
wlib yourlibname
The librarian manual is in the online documentation.
You will, of course, need to compile w/ options consistent w/ the rest
of the files you're linking to.
And, btw, just for the record it doesn't require C/C++ to use dll's...
:) (although system API are in C, one can create/call them in Fortran
as well or call Win32 from Fortran as well, for that matter).
HTH...
--
Suppose you have only three files mainp.for, sub1.for, sub2.for which
contain a main program and two subprograms.
You could put the subroutines in a library thus
wfl386 /c sub1.for
wfl386 /c sub2.for
wlib mylib.lib +sub1.obj +sub2.obj
Then compile and link mainp.for to the library
wfl386 mainp.for mylib.lib
If there are a bunch of obj's to put in the library, it may be more
convenient to list them in a command file that is fed to wlib.
wlib mylib.lib @mylib.wat
For above case, mylib.wat would contain +sub1.obj and +sub2.obj on
separate lines.
What is the complete error message ? Your library may be fine, and one
of the directives on the command line may be bad. The linker guide says
this ...
MSG 2033,3033 directive error near ’%s’
A syntax error occurred while the linker was processing directives. "%s"
specifies where the error occurred.
OK. I downloaded v1.9, and it seems there may well be a bug in wfl386
command line processing. I get the e3033 when I try to build and link to
my own trivial library; near the bottom of what is pasted below. Works
fine in v1.8
c:\temp>wfl386 /c sub1.for
Open Watcom F77/32 Compile and Link Utility Version 1.9
Portions Copyright (c) 1990-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wfc386 sub1.for
Open Watcom FORTRAN 77/32 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
sub1.for: 4 statements, 22 bytes, 1 extensions, 0 warnings, 0 errors
c:\temp>wfl386 /c sub2.for
Open Watcom F77/32 Compile and Link Utility Version 1.9
Portions Copyright (c) 1990-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wfc386 sub2.for
Open Watcom FORTRAN 77/32 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
sub2.for: 4 statements, 25 bytes, 1 extensions, 0 warnings, 0 errors
c:\temp>
c:\temp>wlib mylib.lib +sub1.obj +sub2.obj
Open Watcom Library Manager Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Warning! Cannot open 'mylib.lib' - library will be created
c:\temp>wfl386 mainp.for mylib.lib
Open Watcom F77/32 Compile and Link Utility Version 1.9
Portions Copyright (c) 1990-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wfc386 mainp.for
Open Watcom FORTRAN 77/32 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
mainp.for: 4 statements, 33 bytes, 1 extensions, 0 warnings, 0 errors
wlink @__wfl__.lnk
Open Watcom Linker Version 1.9
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Error! E3033: file __wfl__.lnk: line(4): directive error near
'librarymylib.lib'
Error: Linker returned a bad status
c:\temp>
Thanks, I could not remember the actual wlib commands to save
my life. I just use the wlib trick to create a library from
a DLL.
Lynn
Am 16.07.2010 19:42, schrieb user1:
[...]
> Error! E3033: file __wfl__.lnk: line(4): directive error near
> 'librarymylib.lib'
> Error: Linker returned a bad status
You've found an error in WFL386. It fails whenever a library file is
named on the command line.
The bug happens with one of the "official" fortran sample programs, too:
cd %watcom%\samples\fortran\win32\dll\
wmake
ends in:
wfl386 -q -l=nt dlltest dllsamp.lib
Error! E3033: file __wfl__.lnk: line(5): directive error near
'librarydllsamp.lib'
Error: Linker returned a bad status
Error(E42): Last command making (dlltest.exe) returned a bad status
Error(E02): Make execution terminated
The problem is clearly visible in the error message: WFL386 constructed
a line in its temporary linker script __wfl__.lnk that's supposed to read:
library dllsamp.lib
but instead it generated
librarydllsamp.lib
You can inspect the file by specifying the /fd option to WFL386.
Apparently this was broken by change 36036 in March 2010. I'm preparing
a fix as I'm writing this.
[snip]
> I'm preparing a fix as I'm writing this.
I hope the fix was as simple as adding a trailing space to a string
literal.
Is there a daily build server somewhere from which we can grab a
recompiled wfl386.exe ?
> I hope the fix was as simple as adding a trailing space to a string
> literal.
It was. Finding out how this ended up being broken in the first place
was considerably harder...
I presume the workaround until new wfl386 is available/downloadable
would be to use wfc/wlink individually?
Does seem like a pretty obvious issue that would have shown up but does
seem better than having to rebuild libraries as first presumed might be
OP's problem.
--
> Is there a daily build server somewhere from which we can grab a
> recompiled wfl386.exe ?
See: http://www.openwatcom.org/index.php/Build_Servers
Build Server #1 is off line, but Build Server #2 should be working.
Peter
Yes, I've been watching that. This problem appears solved in the July 18
build.
This is exactly the result I get whenever I try to link my library!
I guess I should go back to v1.7 which was my last version.
Thanks for verifying for me!
>> OK. I downloaded v1.9, and it seems there may well be a bug in wfl386
>> command line processing. I get the e3033 when I try to build and link to
>> my own trivial library; near the bottom of what is pasted below. Works
>> fine in v1.8
...
> This is exactly the result I get whenever I try to link my library!
>
> I guess I should go back to v1.7 which was my last version.
...
See the other postings; there's been a patch made already.
The alternative workaround until you can get that downloaded if there's
a problem w/ either the server or some delay on your end would be to use
wfc386/wlink individually in lieu of the wfl386 utility. All it is in
reality is a convenient front end to the two...
--
I downloaded the above file and all is well!
Thanks Guys (and Gals)!