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

Mixed Language examples

DCooper
초급자
723 조회수

I have been given the task of creating a Fortran dll and linking it to a VB.Net.

I have down loaded and installed

- Visual Studio 2022 (64 bit) ver. 17.14.16 

- Intel oneAPI-HPC-toolkit 2025.2.1.46

- down loaded ipsx2019-samples-win-20190321.zip

Windows 10 pro

I extracted the MixedLanguage example VB_Calls-Fortran

 

When I try to load the solution I first get a message to upgrade to 4.8 framework because the solution framework is no longer supported. Upgrade seems to work.

 

When I try to build the solution I get an error saying that 32 bit is not supported in ifx.

I change both the fortran and vb projects to 64 bit debug.

Everything seems to compile correctly but when I try to run the program without debug I get an exception unhandled message  -- Unable to load DLL 'FCALL.DLL':  The specified module could not be found. -- on line 179 of the Form1.vb code. (Call DLL_ROUT(DBL_IN, MULTIPLIER, DBL_OUT)

I have checked and FCALL.Dll is in the 'VBCallsFortran/bin/debug/' directory along with the VBCallsFortran.exe.

Can someone tell me where I went wrong or do you have an simple example similar to this which works with Visual Studio 2022 and the current ifx.

 

Thanks in advance

David Cooper

 

0 포인트
4 응답
jimdempseyatthecove
명예로운 기여자 III
674 조회수

>>but when I try to run the program without debug

Is this from within MS VS or outside MS VS?

 

If when running the program outside of MS VS then the path to the DLL is not found.

To correct this, either place the DLL in the same folder as the *.exe

.OR.

Register the DLL see this.

Something like

cd \VBCallsFortran/bin/debug
regsvr32 /s FCALL.DLL

jimdempseyatthecove_0-1759582369159.png

When switching to release mode, unregister the debug FCALL.DLL and then register the release FCALL.DLL (which presumably will be located within your distribution directory).

 

Jim Dempsey

 

0 포인트
MWind2
새로운 기여자 III
607 조회수

I started from scratch and it may be useful.

0 포인트
MWind2
새로운 기여자 III
598 조회수

I changed the validation to within BtnAdd and got rid of KeyDown-enter validation in Form1.vb

0 포인트
MWind2
새로운 기여자 III
585 조회수

Also, 

Debug > Options > Debugging > General and uncheck "Enable Just My Code." This allows the debugger to step into external code, including your DLL.
Enable mixed-mode debugging by going to the project's Properties > Debug and selecting "Enable native code debugging"

0 포인트
응답