Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

calling fortran dll from visual c++ dll

nandita
Beginner
782 Views
I'm using CVF and Visual Studio .NET.
I included the Fortran dll in the C++ project, and the compiler and linker do not give any errors.
However when I try to use the C++ dll in Stata, I get an error message saying that the fortran dll was not found.
any clues on what the problem is?
0 Kudos
2 Replies
sabalan
New Contributor I
782 Views
1- If your C++ application is on another computer where CVF is not installed, then you would need some CVF run-time libraries installed on this computer. Download VBFRUN66BI.exe from hereand install it on the computer without CVF.
2- If C++ application is on the same computer as CVF, then check the name, spelling, and argument list of both your CVF DLL and call statement in C++.
3- Check even decorations for exporting your DLL name in CVF. Search for "calling conventions" or "calling fortran from C" in this forum.
Sabalan.
0 Kudos
nandita
Beginner
782 Views
CVF 6.5, Visual Studio .NET 2003, and Stata 8.2 are all on the same computer.

In C the code is


Code:
extern __declspec(dllimport) void __stdcall fcstata(int *n);


In Fortran
Code:
subroutine fcstata(n)
!dec$ attributes dllexport, alias:'_fcstata@4'::fcstata
There are no compile or link errors.
I included the fortran.lib file in the VC project.
I've even triedsaving the fortran .dll in the VC debug directory.
I have no clue what the problem is.

					
				
			
			
				
			
			
			
			
			
			
			
		
0 Kudos
Reply