Callback from Fortran to VB

Callback from Fortran to VB

I'm trying to call bak from Fortran (Visual Fortran) to Visual Basic (VB). Before I added the callback code, my Fortran code compiled and linked without a problem. I list the modifications I have introduced below. But here is the error message I get in the linking process:

" Linking...
LINK : fatal error LNK1181: cannot open input file "imsl.lib"

Error executing link.exe.

Memfor.dll - 1 error(s), 1 warning(s)"

If I remove "imsl.lib" from Project/Settings.../Link/Object/library module, I still get an error message - now over some other object.

Here is the basis for how I am trying to achieve callback.

In VB:
* I have defined a "callback"er function in a global module of VB.
* My call to Fortran has been expanded with one additional argument:

call Fortranroutine(T, AddressOf callback)

In Fortran:
* I have added 4 bytes in the number of argument bytes of the *.def file.
* The Fortranroutine code looks as follows:

subroutine Fortranroutine(T, VBcallback) 
 
real T 
integer i 
integer, external :: VBcallback 
 
i = VBcallback(T) 
....

Question:

--Does anyone see a problem with the way I have tried to organize the callback?

-- Does anyone see what is the problem with the linking process?

Thanks!
-Bernt Lie

2 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

The error message from the link has nothing to do with the way you construct your callback. It simply can'tfind the library. Make sure that the path to ..DF98IMSLLIB is in the list under Tools..Options..Directories..Library Files

Steve

Steve - Intel Developer Support

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui