Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

link lib errors

haizi_cqu
Beginner
619 Views
I want to use some functions from ATLFOR.LIB. I added this lib file to my project and then build it. following error occur (If I add compiler's libraries, no such errors) :
--------------------Configuration: test11 - Win32 Debug--------------------
Linking...
..\\..\\DF98\\LIB\\ATLFOR.LIB : fatal error LNK1136: invalid or corrupt file
Error executing link.exe.
--------------------Configuration: test11 - Win32 Debug--------------------Linking.....\\..\\DF98\\LIB\\ATLFOR.LIB : fatal error LNK1136: invalid or corrupt fileError executing link.exe.

I checked the error, it said that ATLFOR.lib fileeither has a corrupt header or is zero size or abnormally small. However, other guys use this files two years ago successfully.
Does anybody know how to fix this error?
Also, I want to read the content of library files like ATLFOR.LIB. Does anybody know how to read a file as ATLFOR.LIB? I donot have any fortran code to rebuild the lib again. If I can have access to the content to the library files, I can rebuild them.
Thanks.
0 Kudos
6 Replies
mecej4
Honored Contributor III
619 Views
The file ATLFOR.LIB does not begin with the signature ! that is expected in every COFF library file. Do you know the origin of this library? Could it be a 16-bit library that was used with earlier 16-bit Fortran compilers? If so, you will need to obtain a 32-bit version of the library.
0 Kudos
haizi_cqu
Beginner
619 Views
Quoting mecej4
The file ATLFOR.LIB does not begin with the signature ! that is expected in every COFF library file. Do you know the origin of this library? Could it be a 16-bit library that was used with earlier 16-bit Fortran compilers? If so, you will need to obtain a 32-bit version of the library.

ATLFOR.LIB is from a software called ATLAB. After the ATLAB installed, there are ATLFOR.LIB in the files. Unfortunately, We donot have the install disk for ATLAB, and the ATLAB in my old computer was installed several years ago. So I do not know how they create this library.
Now the thing is, why I cannot link this library while previous guys can link? How can I open a file such as ATLFOR.LIB?
Thanks, Mecej4.
0 Kudos
mecej4
Honored Contributor III
619 Views
But for a few rare exceptions, 16-bit objects and 32-bit objects cannot be linked. Similarly, 32-bit objects and 64-bit objects cannot be linked. You will need to obtain either the source code to ATLFOR.LIB or a 32-bit version of the library. Alternatively, you my find an older computer that runs, say, Windows-95, install a 16-bit compiler such as MS Fortran 5.1 (or OpenWatcom) on it, and link to the 16-bit ATLFOR.LIB that you have.

I do not know what you mean by "open the library". You can dump the contents in hex, or open it in a binary editor, but to what purpose? It would be far more worth your time to ascertain the specifications of the library and have one written for your present compiler.

In view of the fact that neither Intel nor COMPAQ/DEC released an MSDOS compiler, this thread is now quite a bit off-topic.
0 Kudos
haizi_cqu
Beginner
619 Views
Quoting mecej4
But for a few rare exceptions, 16-bit objects and 32-bit objects cannot be linked. Similarly, 32-bit objects and 64-bit objects cannot be linked. You will need to obtain either the source code to ATLFOR.LIB or a 32-bit version of the library. Alternatively, you my find an older computer that runs, say, Windows-95, install a 16-bit compiler such as MS Fortran 5.1 (or OpenWatcom) on it, and link to the 16-bit ATLFOR.LIB that you have.

I do not know what you mean by "open the library". You can dump the contents in hex, or open it in a binary editor, but to what purpose? It would be far more worth your time to ascertain the specifications of the library and have one written for your present compiler.

In view of the fact that neither Intel nor COMPAQ/DEC released an MSDOS compiler, this thread is now quite a bit off-topic.

Sorry for off topic.
I did run the program in a Window 95 computer using Microsoft Fortran powerstation 4.0. But, it still shows the same errors.
God, I really have no idea how to fix this error.
0 Kudos
mecej4
Honored Contributor III
619 Views
Powerstation 4 was a 32-bit compiler. Objects compiled by it are not compatible with 16-bit objects.

I dug up an installation of Microsoft Fortran 5.1 on an old computer, and used its LIB.EXE to list the contents of ATLFOR.LIB. As I guessed, it is a 16-bit library, and the listing is in the attached text file.
0 Kudos
haizi_cqu
Beginner
619 Views
Quoting mecej4
Powerstation 4 was a 32-bit compiler. Objects compiled by it are not compatible with 16-bit objects.

I dug up an installation of Microsoft Fortran 5.1 on an old computer, and used its LIB.EXE to list the contents of ATLFOR.LIB. As I guessed, it is a 16-bit library, and the listing is in the attached text file.

Thanks Mecej4.
Have a good day.
P.S. You know, you help me a lot. I should definitely buy you a dinner.
0 Kudos
Reply