Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
20 Views

Mixed language Fortan - C++ problem with Parallel Studio XE 2017

I have been having a problem with mixed language Fortran - C++ projects with the new 2017 compilers.

The 2017 libifcoremd.lib and libifcoremdd.lib libraries now include a defaultlib directive for static Standard C++ library libcpmt but the C++ part of my application uses the dynamic link versions msvcprt.lib or msvcptrd.lib and the linker complains about this.

Using the /nodefaultlib linker option for the libcpmt.lib library allows the application to link but my application crashes with the new compiler. Is it safe to use the /nodefaultlib:libcpmt or could this be the cause of the crashes? 

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.0.109\windows\compiler\lib\intel64>dumpbin /DIRECTIVES libifcoremd.lib
Microsoft (R) COFF/PE Dumper Version 12.00.40629.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file libifcoremd.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   -defaultlib:libcpmt
   -defaultlib:libirc

...

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\compiler\lib\intel64>dumpbin.exe /DIRECTIVES libifcoremd.lib
Microsoft (R) COFF/PE Dumper Version 12.00.40629.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file libifcoremd.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   -defaultlib:libirc

...

 

 

 

 

0 Kudos
4 Replies
Highlighted
20 Views

Patient: Doctor, it hurts when I do this!
Doctor: Well, then don't do that!

Link to the DLL Fortran libraries, don't mix static and dynamic this way - you'll only hurt yourself.

0 Kudos
Highlighted
Beginner
20 Views

How do you tell Parallel Studio XE 2017 to use DLL libraries?

I have a Fortan main program project using a C++ static library.

The Fortan project uses:
Runtime Library: Debug Multithread DLL (/libs:dll /threads /dbglibs)

The C++ project uses: 
Runtime Library: Multi-threaded Debug DLL (/MDd)

Adding /VERBOSE to the link line I see that libifcoremdd.lib is used and libifcoremdd.lib uses libifcoremdd.dll.

dumpbin /DIRECTIVES on libifcoremdd.lib shows that it uses libcpmt.lib (-defaultlib:libcpmt) for the static C++ standard library when I would expect it to use msvcprtd.lib for the dynamic link C++ standard libary.

The verbose linker output shows that both libcpmt.lib and msvcprtd.lib are being searched.
In simple "hello word" style tests the linker output shows that libcpmt.lib is unused but in my real application there is a conflict.

The Parallel Studio XE 2016 libifcoremdd.lib did not have -defaultlib:libcpmt and I had no problem linking my application.

 

 

 

0 Kudos
Highlighted
20 Views

Set the linker property General > Show Progress to "Show some progress messages", rebuild and post a ZIP of the buildlog.htm here. Or read it yourself to see where each library was referenced. You may be pulling in object or library you didn't rebuild. The properties you mentioned above are how you set the libraries.

0 Kudos
Highlighted
Beginner
20 Views

Thank you for your advice.

I tracked the linker problem down to using boost without defining BOOST_ALL_DYN_LINK.

The crash turned out to be due to a new bug with omitted intent out optional arguments with abstract types (I will post an example in a new thread).

 

 

0 Kudos