I have created a solution MYAPP. Within the solution I have a C# WPF (MYAPP) and a Fortran DLL (MYDLL). A wrapper class (MYWRAPPERCL) calls the Fortran DLL.
When I attempt to call the DLL I receive the following message:
An unhandled exception of type ‘System.EntryPointNotFoundException’ occurred in MYAPP.exe
Additional information: Unable to find an entry point name ‘MYENTRYPT’ in DLL ‘c:\Users\me\My Documents\Visual Studio 2013\Projects\MYAPP\MYDLL\Debug\MYDLL.dll’
Here is what I have checked so far; nothing changes the error message:
1 - I have altered the call to the DLL as:
[DllImport(“c:\\Users\\me\\My Documents\\Visual Studio 2013\\Projects\\MYAPP\\MYDLL\ \Debug\\MYDLL.dll", EntryPoint = "MYENTRYPT", SetLastError = true,
CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern int MYENTRYPT();
2 - I have altered the call to the DLL as:
[DllImport("c:\\Users\\me\\Documents\\Visual Studio 2013\\Projects\\MYAPP\\MYDLL\\Debug\\MYDLL.dll", EntryPoint = "MYENTRYPT", SetLastError = true,
CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern int MYENTRYPT();
3 - I have altered the call to the DLL as:
[DllImport("MYDLL.dll", EntryPoint = "MYENTRYPT", SetLastError = true,
CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern int MYENTRYPT();
4 - In Solution Explorer/Properties the Project Folder for the MYDLL is set to:
c:\Users\me\Documents\Visual Studio 2013\Projects\MYAPP\MYDLL\
5 - I verified that the DLL is located in:
c:\Users\me\My Documents\Visual Studio 2013\Projects\MYAPP\MYDLL\Debug
6 - Linker command line for MYDLL:
/OUT:"Debug\PMC.dll" /VERBOSE /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\MYDLL.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\me\Documents\Visual Studio 2013\Projects\MYAPP\MYDLL\Debug\MYDLL.pdb" /SUBSYSTEM:WINDOWS /IMPLIB:"C:\Users\me\Documents\Visual Studio 2013\Projects\MYAPP\MYDLL\Debug\MYDLL.lib" /DLL
History
- Other projects (other than dll) compiled and run from the Projects subdirectory compile and execute without exception.
- At one point in time I renamed the DLL folder to MYDLL; was able to compile and link successfully after the change.