- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi
I have a C# console app calling a Fortran DLL. Both are x64. (at least I thought so)
It runs fine on my PC but when I port it to another machine it falls over with Exception encountered An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B).
It seems when I examine the Fortran DLL with Dependency Walker that it's hoping to load c:\program files (x86)\common files\intel\shared libraries\redist\ia32\compiler\LIBIFCOREMDD.DLL etc.
how can I ensure that the correct 64 bit support is redistributed with the 64 bit Fortran dll...
I have checked the other posts on similar questions but it's not clear to me what I am missing.
I am not even sure where to start looking :-}
Many thanks for your help!
Best wishes
Paul
- Marcas:
- Intel® Fortran Compiler
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
64-bit Windows will skip over the "wrong architecture" DLLs when searching PATH - 32-bit Windows will not. But I have seen that for managed code (.NET) applications that call native code DLLs, you must build the application to target a specific CPU type and not "Any CPU", or else you'll get problems like this.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Brilliant - thanks Steve I shall go through the many projects making this up to ensure we've not got any running as Any CPU.
Thanks
Paul
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi - I have ensured that every project in the solution is set to x64. I am confused by the fact that the Fortran dll itself when loaded into Dependency Walker gives an error "Error: Modules with different CPU types were found." and highlights error occurring in the following nested list (the first item is my fortran dll)
d:\work\dds1202_icoasst\work\liverpoolbay64\bin\x64\debug\UNALINEA_OMI_FTNENGINE.DLL
c:\program files (x86)\common files\intel\shared libraries\redist\ia32\compiler\LIBIFCOREMDD.DLL
c:\program files (x86)\common files\intel\shared libraries\redist\ia32\compiler\LIBMMD.DLL
I can't figure out why DependencyWalker (64 bit) considers that UNALINEA_OMI_FTNENGINE.DLL refers to the ia32 redistributables?
Currently flummoxed.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
DependencyWalker, inexplicably, doesn't do what Windows does for DLL searches, so you should ignore those errors. I know that I got the "incorrect format" error until I explicitly set the architecture for the .NET application. Are you saying it still doesn't work?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Yes I am :-) - in fact on the machine it fails on (I've got dependency walker on there now) the error when loading says the following cannot be found:
MSVCR110D.DLL
IESHIMS.DLL
Which is a bit odd...
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
IESHIMS can be ignored. But the other one is important - it tells me that you've linked your DLL against the "Debug" runtime libraries, and that is not portable to another system. Rebuild in a Release configuration, or at least with the runtime libraries set to "Multithread" or "Multithread DLL".
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Oh my! Steve, thank you so very much! I had no idea that was the case - it all works beautifully now thank you.
Also, can I take this opportunity to say I have only recently joined this forum and had two questions answered with patience, courtesy and skill. This is all too rare an experience on the web so thanks Intel for a great and extremely useful forum.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
You're very welcome!

- 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