- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that you attached the wrong picture; I cannot relate your description to the content of the image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry. Picture updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you all for the responses. adding -lstadc++ to the link flags solved the problem!
Dave

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page