Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

linking failure with c++ libraries

dajum
Novice
1,070 Views

I'm trying to add some new functions from a c++ library to one of my existing fortran projects. The library compiles and builds fine, but when I go to link I get errors that I don't understand where they come from and am hoping someone else does.  Maybe there is some additional system library that I have to add to the linker commands that isn't automatic?  Library is built using icc.   So why does it think all the std::string functions are undefined as shown in the attached picture.

 

0 Kudos
6 Replies
mecej4
Honored Contributor III
1,071 Views

I think that you attached the wrong picture; I cannot relate your description to the content of the image.

0 Kudos
dajum
Novice
1,071 Views

Sorry.  Picture updated.

0 Kudos
mecej4
Honored Contributor III
1,071 Views

It would be quite useful to know the command used for the link attempt, in addition to the linker errors that you showed. For example, did you try to link with IFort, Icc, or some other way? 

0 Kudos
Lorri_M_Intel
Employee
1,071 Views

If you are using "ifort" to do the link step, then no, the C++ libraries are not linked automatically.

Please try using "-cxxlib" to bring those in.

If that does not help, then we will need all the information that mecej4 requested in the previous reply!

            thanks -

                           --Lorri

0 Kudos
TimP
Honored Contributor III
1,071 Views

The usual linux Fortran link option when there are calls to functions requiring C++ libraries is -lstdc++ .

As implied above, there are too many possible ways to set up the link step for us to guess without full information.

0 Kudos
dajum
Novice
1,071 Views

Thank you all for the responses.  adding -lstadc++ to the link flags solved the problem! 

Dave

0 Kudos
Reply