Startbeitrag von Bui Thanh Tam am 10.02.2001 18:08
Dear friends,
I am interesting in using JAPI for my fortran program. I am currently using MS Fortran Powerstation4 and Compaq Visual Fortran 6.5. Can any one tell me how to compile JAPI source under these two compilers. And I can not find japi.f in the download source.
Many thanks
I am interesting in using JAPI for my fortran program. I am currently using MS Fortran Powerstation4 and Compaq Visual Fortran 6.5. Can any one tell me how to compile JAPI source under these two compilers. And I can not find japi.f in the download source.
Many thanks
Antworten:
Re: How to make JAPI under MS Fortran Powerstation
and CVF6.0:
First: Since both Fortran Powerstation 4.0 and CVF6.0 do DLL, grab the JAPI LF95
(japi.dll, japi.lib, japi.f and some examples.f) and try it.
There three things can happen:
1. evrything works. that's great
2. you get LINK Error of the kind: Undefined symbol "J_ADD"
in module "button.f" at location000110D5.
This is still not bad.
What this error means is the exported symbol does not match the
imported symbol.
In this case you get rid of japi.lib and replace it with your own. For this
you need to have BC5.5 , LCC or some other C compiler that have
tools like impdef.exe and implib.exe
In creating your own japi.lib this is what you do:
Run impdef on japi.dll to creat a text file japi.def
this is just a file of exported symbols and looks like this
LIBRARY JAPI.DLL
EXPORTS
DllMain = _DllMain@12
j_add_ @2 ; j_add_
j_additem_ @3 ; j_additem_
j_alert0_ @4 ; j_alert0_
j_alert1_ @5 ; j_alert1_
j_alert2_ @6 ; j_alert2_
j_alert3_ @7 ; j_alert3_
Here you see the problem , the DLL exports j_add_ and the program in
the case of the above error, is trying to import J_ADD
( Note in your case tis might be different)
the solution is symbol aliasing. For this case you edit japi.def as such
LIBRARY JAPI.DLL
EXPORTS
J_ADD = j_add_
J_ADDITEM = j_additem_
J_ALERT0 = j_alert0_
J_ALERT1 = j_alert1_
J_ALERT2 = j_alert2_
J_ALERT3 = j_alert3_
Now you run implib.exe on the modified japi.def to produce japi.lib
and everything shoul work fine
3. You dont even get undefined symbol error. Here you check the
keyword for importing symbols in japi.f it is DLL_IMPORT (ala lf95)
check how Fortran Powerstation 4.0 and CVF6.0 do it, and edit japi.f
accordingly. And if you get undefined symbols you go to 2
I think and hope this will easily solve your problem .
Regards
Abdul
von Abdul - am 11.02.2001 22:39
Re: How to make JAPI under MS Fortran Powerstation
Merten
von Merten - am 12.02.2001 17:01
MS Fortran Powerstation 4
Merten
von Merten - am 19.02.2001 10:57