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

fortran dll with library call not recognize from vb code visual studio 2019

Carob
Beginner
1,721 Views

Hello,

I'm using Visual Studio 2019.

I have a Vb project  that is calling a dll  in fortran that i  wrote.

The fortran code is using the library LINK_FNL_SHARED.H.

When i ran the vb project that is calling the dll,i received an error:"system.dllnotfoundexception".

Both the vb project and fortran project are in debug mode x64.

 

-But when i try to mark in comment the line code: CALL RNSET(ISEED),CALL RNUN(NR,R)

all is fine and the dll is recognized and the code is running!

 

I have added the path of the library ,the dll and the linker also.

I have tested and tried to create a project only in fortran using this library with no vb and the code is succesfull !

What am i missing in my vb project so that it can call the fortran dll using a call to LINK_FNL_SHARED.H lib?

Please see the attached files of my code .

Thank you

 

 

 

 

0 Kudos
5 Replies
mecej4
Honored Contributor III
1,710 Views

Your code uses routines from the IMSL library. If, when your VB program is run, the IMSL DLLs are not accessible through the PATH environment variable, the program will abort.

If RNSET and RNUN are the only IMSL routines that are needed, you could use the Fortran intrinsics RANDOM_SEED and RANDOM_NUMBER instead, and remove the dependency of your VB project on IMSL.

Please do not confuse yourself and readers by calling LINK_FNL_SHARED.H as a "library". That include file, which is  all of 40 bytes in length, simply adds an OBJCOMMENT directive for the linker to use. The library itself is called imslmkl_dll.lib .

0 Kudos
Carob
Beginner
1,708 Views

Hi thank you,

But RNSET and RNUN are the NOT only the  IMSL routines that i need!

how can i make my project run?

Thank you

 

0 Kudos
Carob
Beginner
1,703 Views

I had also tried to add directly to the vb and fortan project the  imslmkl_dll.lib but still the same error

0 Kudos
mecej4
Honored Contributor III
1,706 Views

Which other IMSL routines do you use? I have to note that your screenshots contain little useful information that I can use.

0 Kudos
Steve_Lionel
Honored Contributor III
1,690 Views

Adding a .lib to a VB project will not do anything useful.

VB will say "DLL not found" when a dependent DLL isn't found. If you have purchased IMSL, you'll need to make sure that its DLLs are in a folder included in the PATH system environment variable. You can contact Rogue Wave for support on IMSL.

0 Kudos
Reply