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

test Intel Fortran Compiler with DLL and c#

babe59
Beginner
520 Views
Hello,

I try to create A DLL since Fortran code and it doesn't work on my Visual studio 2005 C# application...

1 step : I created a DLL Fortran Code named C:\Temp\test\dll.for
----------------------------------------------------------------------------

SUBROUTINE ARRAYTEST()
!DEC$ ATTRIBUTES DLLEXPORT :: ARRAYTEST
REAL(4) arr(3, 7)
INTEGER i, j

DOi = 1, 3
DO j = 1, 7
arr (i, j) = 11.0 * i + j
END DO
END DO
END SUBROUTINE



2 Step : I compile :
------------------------
ifort /dll dll.for



3 Step : A create a C# program
--------------------------------------

usingSystem.Windows.Forms;
using System.Runtime.InteropServices;

namespace testDLL
{
public partial class Form1 : Form
{
[
DllImport("dll.dll")]
private extern static void ARRAYTEST();

public Form1()
{
InitializeComponent();
ARRAYTEST();
}but when i execute my program I've an error : unable to load dll 'dll.dll'. (dll was not found).

I put DLL in my solution (as a file because I can't add as a reference) and dll are copied on \debug directory...
Could you help me ?


PS : Why can' i insert DLL.DLL as a reference in my projet ?
0 Kudos
0 Replies
Reply