- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
We're in the process of upgrading from IVF 11.1 on VS2008 to IVF Composer XE 2013. We have a large solution (200+ projects) with a mixture of C++ & Fortran DLL projects that have many dependencies between them. I understand that implicit linking of Fortran DLL projects with dependant C++ DLL projects using the project dependencies no longer works. I've moved to explicit linking of the dependencies using the 'Additional Dependencies' linker option as suggested, but this approach doesn't allow me to specify which are the dependant projects and hence the build order. If I leave the project dendencies in place, as well as specifying the explicit linkage, the link fails with messages like this:
1>------ Build started: Project: CLib2, Configuration: Debug Win32 ------
1> stdafx.cpp
1> CLib2.cpp
1> dllmain.cpp
1> Creating library C:\Data\MixedLanguage\MixedLanguage\Fortran_Calls_C\Debug\CLib2.lib and object C:\Data\MixedLanguage\MixedLanguage\Fortran_Calls_C\Debug\CLib2.exp
1> CLib2.vcxproj -> C:\Data\MixedLanguage\MixedLanguage\Fortran_Calls_C\Debug\CLib2.dll
2>------ Build started: Project: Fmain2, Configuration: Debug Win32 ------
2>Compiling with Intel(R) Visual Fortran Compiler XE 13.0.1.119 [IA-32]...
2>Fmain2.f90
2>Linking...
2>ipo: error #11018: Cannot open C:\WINDOWS\system32\C:\Data\MixedLanguage\MixedLanguage\Fortran_Calls_C\Debug\Fmain2.lib
2>LINK : fatal error LNK1104: cannot open file 'C:\WINDOWS\system32\C:\Data\MixedLanguage\MixedLanguage\Fortran_Calls_C\Debug\Fmain2.lib'
2>
2>Build log written to "file://C:\Data\MixedLanguage\MixedLanguage\Fortran_Calls_C\Fmain2\Debug\BuildLog.htm"
2>Fmain2 - 2 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How do I specify that the dependant C++ projects are built first?
Thanks
Dave
- Marcas:
- Intel® Fortran Compiler
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Update 2 seemed to improve things. We've been able to reconstruct our multi-project solution over a couple of days. However we still had a issue linking that had to be worked around. I'm wondering whether this is an issue with relative paths.
What I saw was that when a Fortran project had a c++ project as a project dependency, trying to build the Fortran dll gives the following error:
LINK : fatal error LNK1181: cannot open input file 'C:\Program Files (x86)\Release\Phases.lib'
In reality the c++ project is creating the lib file in a folder c:\rms\mde\dev\..\Release\
This didn’t happen if the project dependency was removed and the c++ lib file was added as an additional dependency in project properties -> linker -> input -> additional dependencies, unfortunately we couldn’t do that as we need to set project dependencies to get the build order right
To work around this, the path of the lib file (originally ..\..\..\Release) in the c++ project had to be changed to $(OutDir)$(TargetName).lib, that is in:
Project properties -> Linker -> Advanced -> Import Library
This doesn’t have an effect on the actual location of the c++ lib file (it is still generated in the same place) but this way the Fortran project picks up the right path to look for the lib file.
Were we doing something wrong using a relative path?
Dave
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
That reads like the pre-update-2 behavior. I tried a test case I had which failed with Update 1 but it succeeded with Update 2. VS2012 does not allow Fortran to see the output library of a C++ dependent DLL project, so you'll have to add the dependency manually. However, Advanced > Import Library is NOT the place to do that. This specifies the OUTPUT location of an import library when building a DLL. You want to add the C++ project's .lib under "Input > Additional Dependencies".
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Sergey, the path in the first post wasn't created by us. I think this is part of the bug fixed in Update 2.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Steve, we are already adding the dependencies manually to our Fortran project using "Input > Additional Dependencies". Our issue seems with the use of relative paths (??) in the creation of the C++ import library. Things don't seem to want to link if we use a relative path for the library creation, but an absolute path works.
Dave
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Remember that the default path is that of the project, not the intermediate (Debug/Release) folder. You can use the macros such as $(IntDir) or $(ProjDir) to establish an initial path, and then use .. as needed from there.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I think the issue here is that the relative path is being converted to an absolute path using the wrong starting point. We specifed a relative path that doesn’t move back up the folder hierarchy (i.e. .\test) and the Fortran project tries to link the following library (unsuccessfully).
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\test\Phases.lib"
We will stick to using absolute paths as Steve suggested. The starting point for relative paths appears to be the IDE directory, instead of the project directory.
Dave
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora