- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK as the subject says I have solutions with two projects - one for the Fortran code and one for the C or C++ code. Mostly the C project is the "master" project and the Fortran is the secondary project. (So the C project depends on the Fortran.)These solutions build libs to be linked by other solutions into several exes.
Usually the projects have just two configurations - Debug and Release. Occasionally there are other configs (Log_debug, Log_release, Debug_s, Release_s and so on) and it is these that have been causing me problems. The Fortran project has an intermediate directory of .debug_s_f90 for the obj files and .debug_s for the fortran lib file. (and similar for the other configs.) This fortran lib to be linked with the C obj files to make the final lib.
On first upgrading from VS2003 to VS2005 I discovered that for the C Project the "Configuration Properties, Librarian,General" tab required the "Link Library Dependencies" to be set to "yes" (prior to that the Fortran code compiled, and was listed in the output window, but theintermediate lib file was not combined withthe c obj files to make the final lib, giving unresolved references when making the exes!) I assumed the dependencyshould be resolved by the linker to the correct location for the Fortran lib.
Today I was having problemsdue tothe "other" configurations, when linking the exes. I was getting messages like :
libifcoremt.lib(for_init.obj) : error LNK2005: _for_set_fpe_ already defined in libifcoremdd.lib(libifcoremdd.dll)
LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR80D.dll)
and so on
After some head scratching I found that looking again at the C project Configuration Properties, Librarian,Command Line I noticed it was accessing the wrong intermediate Fortranlib to link with the C objects to make the final lib. TheC debug_s configwas combining with the Release Fortran lib. The dependency was NOT looking in the correct location.
I had to specify the relative path to the Fortran lib in the C "Configuration Properties, Librarian, General, Additional Dependencies" boxand set "Link Library Dependencies" to "no"
Fortunately this changewas required in only a few of our projects though it affected lots of exes which depended on the libs being built. But I thought others may come across this problem and so decided to post what I'd found here.
Sorry for the lengthy explanation.
Les
Link Copied

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