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

How to use static library files (.a files)?

algebra
Beginner
607 Views
Hello, I have .a file, and I think that stands for static library file. I've tried to include it in my project under Project Properties | Linker | Input | Additional Dependencies, but I still get error LNK2019.

Searching through the forums, I have also downloaded makelib.exe and made a .lib file instead, but the linker doesn't like it either.

This is on Windows XP.
0 Kudos
3 Replies
g_f_thomas
Beginner
607 Views
.a files mean squat on any version of Windows. So what are you talking about?

Ciao,
Gerry T.
0 Kudos
algebra
Beginner
607 Views
I found a solution to my problem.
Compile source files to object files with "ifort /c myfile.f".
Then put them in a library with "lib /out:libmy.lib myfile.obj".

I was thinking of .a files since another compiler (not gcc) actually recognizes .a files created with "ar" (cygwin), under windows xp.

However, my question still applies to ATLAS BLAS libraries. I had to get cygwin to run them under windows, and they ultimately create .a files. Can I use them with Intel Fortran?
0 Kudos
TimP
Honored Contributor III
607 Views
Not sure what you're getting at. Cygwin .a files work the same as .lib files when only 32-bit object files are involved. As they don't carry a /machine tag, they don't work with 64-bit objects. No compiler uses .a files, only the ar and linkers do. There is no conversion of objects which go into a .a file. If they aren't compatible with other objects at link time, they won't work.
If, for some inscrutable reason, you are trying to mix g77 or maybe gcc objects with ifort objects, you will have to give attention to options like ifort -Qlowercase -us, g77 -fno-second-underscore, and avoid mixing run-time libraries.
0 Kudos
Reply