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

Using fortran & c++ together in version v9.0.021

Wee_Beng_T_
Beginner
586 Views

Hi,

my school's using ifort & icc v9.0.021, Build 20050430. I'm trying to compile a library called hypre which interlinks fortran & c++.

It gives an error message saying fortran can't link with c++ object. Is it becuase this version is too old? Is there any workaround?

Thanks

0 Kudos
2 Replies
TimP
Honored Contributor III
586 Views
Did you compare what you are doing with the examples provided with your copy of ifort, as well as the documentation of the library? If you mean by "c++ object" that you don't want to declare "extern C" then you are outside what is supported in any portable way, probably not following the instructions which come with hypre, and you will surely have to read the documentation specific to ifort. If you are using their Fortran interface, the interface for gfortran should be easy to use with ifort, g77 interface not so easy. There are too many ways to do the job (1 more if you would use a current compiler) and too many things you might be trying, for us to guess which you have chosen.

0 Kudos
Ron_Green
Moderator
586 Views
You gave us the version of icc you use, 9.0.021. What is your ifort version? I should be of the same major version as your icc, so it should be 9.0.xxx. You need to make sure your compilers are the same major version.
0 Kudos
Reply