Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Fortran DLL called from C# program

Ramesh__Krish
Beginner
576 Views

Hi, I have a C# program (VS 2013) that calls a Fortran DLL (Intel Parallel Studio XE 2017). When I build the DLL (x64), all the files compile without any issue, however on the Linking, I get the following error:

mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "....\x64\Debug\TestDLL1.dll". The operation failed.

When I go to the folder, I find the DLL has been created. Q1: Does this mean, the DLL cannot be used?

Q2. I am not sure if the above is related to this question. Anyway, I have a C# frontend (simple code to call the Fortran DLL). When I try to call the Fortran DLL from the C# EXE, I get an error saying that the Fortran DLL cannot be found (though the path and file are correct). I went into the Fortran DLL and added some breakpoints and linked it up to the C# EXE. When I run the Fortran DLL from inside the VS debugger, the program runs fine.

Any idea how to fix the DLL link issue? Please let me know if you need more details.

 

0 Kudos
1 Reply
Steve_Lionel
Honored Contributor III
576 Views

Here’s what’s going on. Your DLL gets created by the linker. Next, Visual Studio runs mt.exe, the Manifest Tool, to rewrite the DLL to add the manifest that tells WIndows how to find the dependent Microsoft libraries (but not the Intel libraries.) Sometimes, especially if you have an antivirus tool that does “real-time” analysis, the DLL is opened for exclusive access by the AV tool and this prevents the Manifest Tool from embedding the manifest.

The simplest solution is to tell your AV program to exclude your development area from this scanning. You can also set the linker property to not embed the manifest, but this can sometimes cause other problems.

0 Kudos
Reply