errors linking C++ projects with fortran projects in VS2010

errors linking C++ projects with fortran projects in VS2010

Hi,

We've just converted our C++ and fortran projects from VS2008 to VS2010, with the new intel compiler (v12).
However, we're getting some weird errors when linking a C++ DLL with a fortran DLL:

1>ipo: error #11018: Cannot open D:\\codebase\\projects\\Common\\../bin/DebugCommon.lib
1>LINK : fatal error LNK1181: cannot open input file 'D:\\codebase\\projects\\Common\\../bin/DebugCommon.lib'

Our directory structure is something like;

\\common - C++ project code folder
\\fortran_proj1 - fortran project code folder
\\bin\\debug - debug DLL/EXEoutput folder
\\bin\\release - release DLL/EXE output folder

This error only happens when using the solutions' project dependencies. When using only the linker input (additional dependancies) with the C++ .lib file, it works fine. We need to use the project dependencies to get the build order right (we have 56 projects, including 10 fortran DLLs).

Any ideas?

Cheers,
Nick.

10 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Steve Lionel (Intel)

I see forward slashes in the paths - did you put those there?

Steve

the fortran project had '../bin/debug' in the "output directory" in the project configuration. Ive changed it to "..\bin\debug" and it still gives me the same errors.

actually, changing the output directory to "..\bin\debug" seems to have fixed it...?

Scratch that. It seems to be getting the path to the C++ lib file incorrectly alot.

Sometimes I'm getting:
1>ipo: error #11018: Cannot open C:\Windows\system32\..\bin\Debug\Common.lib

other times it looks for it in a different subfolder of another project being compiled, ie.
1>ipo: error #11018: Cannot open D:\codebase\projects\subfolder\cproj_2\..\bin\Debug\Common.lib

this is looking like an internal compiler problem..?

Bild des Benutzers Steve Lionel (Intel)

Can you attach a zip containing the .vfproj files for the projects and the buildlog.htm that fails?

Steve

Attached is a small example C++ DLL and fortran app that reproduces the issue.

It seems to be related to the /IMPLIB linker option in the C++ projects. When /IMPLIB:$(outdir)\common.lib is specified, the fortran project cant find the library. When you remove the /IMPLIB option, it finds it okay.

For now I've removed all /IMPLIB options from our projects, and instead use the $(targetpath) and $(targetname) options to ensure our libs/dlls use the correct names.

Is this a bug or am I using the option incorrectly?

Anlagen: 

AnhangGröße
Herunterladen TestLink.zip12.07 KB

,Hi Steve

Has anything has happened with this issue? I'm still experiencing this problem in VS 2012 with the latest fortran compiler and on some projects removing the IMPLIB doesnt seem to fix it. Is this a bug in the compiler? Do you have any suggestions how to resolve it?

Cheers.

Bild des Benutzers Steve Lionel (Intel)

Sorry, I missed updating this. Right now the ZIP you attached is not working (I think this is our problem not yours). I do know of an issue with VS2012 and dependent C++ projects where the Fortran VS integration tries to link in a nonexistent library. This will be fixed in Update 2 and a workaround is to set the property Linker > General > Link Library Dependencies to No. I am not sure if this is your issue.

Steve

Thats the flag I missed, thank you. Most of our projects have all dependancies defined in the Linker->Input->Additional Dependancies anyway so this workaround works well for us.

Thanks for the quick response!

Melden Sie sich an, um einen Kommentar zu hinterlassen.