0

As an absolute beginner on Linux and C++, I would like to know if there is a way to use *.a lib library in C++.

I have a scientific *.a library generated from FORTRAN code. On the other hand, I am planning to write some programs in c++ on Linux system. In that case, how can we use this *.a library with C++, or if not then how do we convert it to the one which can be used in C++ (most importantly on Linux system).

I will be using Eclipse as IDE for C++.

Indigo
  • 2,887
  • 11
  • 52
  • 83
  • 1
    Is your Fortran compiler's ABI/calling convention the same as the C calling convention? –  Aug 16 '13 at 12:34
  • Look at:http://stackoverflow.com/questions/5663083/linking-fortran-and-c-binaries-using-gcc and http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html – user2672165 Aug 16 '13 at 12:35
  • @H2CO3: Humm, that I have no idea about since it is a pre-build library. Though, I am quite sure that the answer is no, it is not C or C++ calling convention – Indigo Aug 16 '13 at 12:55
  • @user2672165: Thanks, that link helped. But I guess this is rather difficult. I will have to use this library on a large scale and making sure of all DataTypes and other inputs compatible with FORTRAN, can be a big source errors and efforts. – Indigo Aug 16 '13 at 12:57
  • I was hoping something like converting this library to C++ compatible library – Indigo Aug 16 '13 at 12:58

0 Answers0