- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to share that I am connecting Java with Fortran DLL and this works just only with Intel compiler in MAC but it does not work with Windows compiler. I have no idea why.
With other compilers like g95 and gfortran works well, so I would like to push Intel Fortran Developer to debug this.
FUNCTION mult(a, b) BIND(C, name='foomult') INTEGER,VALUE :: a,b INTEGER :: mult mult = a * b END FUNCTIO
When you call foomult from java you receive next error:
This only happend on windows with Intel compiler.Error looking up function 'foomult': The specified procedure could not be found.
Thanks,
Miguel
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Probably because the C compiler convention of an underscore prefix is used, so the global name is _foomult, just as it would be if you wrote the same funcion in C. I also don't see an ATTRIBUTES DLLEXPORT directive there - without that no names are exported to the DLL. (This is something Windows requires.)
Unfortunately, Intel Fortran won't let you have both BIND(C) and ATTRIBUTES ALIAS - the latter would be needed to get rid of the underscore. You will probably have to remove the BIND(C) and then add:
!DEC$ ATTRIBUTES DLLEXPORT,ALIAS:"foomult" :: mult
Unfortunately, Intel Fortran won't let you have both BIND(C) and ATTRIBUTES ALIAS - the latter would be needed to get rid of the underscore. You will probably have to remove the BIND(C) and then add:
!DEC$ ATTRIBUTES DLLEXPORT,ALIAS:"foomult" :: mult
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I again, and thank you for your quick answer.
I changed to undersocer prefix and it did not work. In addition I have removed BIND(C) and I used !DEC$ ATTRIBUTES DLLEXPORT,ALIAS:"foomult" :: mult but the problem remain in the same way.
When I call it from java the same message apeears:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'foomult': The specified procedure could not be found.
It is strange that just only happen in window, because in mac works and with other gnu compiler works too.
I have no idea why.
Thanks again,
Miguel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you attach your DLL as a file here? See my signature for how to attach.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I explained above, if you don't use the !DEC$ ATTRIBUTES directive with the DLLEXPORT clause, no routines will be visible in the DLL. You must add the directive and remove the BIND clause to make it work on Windows.
The DLL you attached did not export any names. This is a difference between Windows and Linux.
The DLL you attached did not export any names. This is a difference between Windows and Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am sorry. Now with the
!DEC$ ATTRIBUTES DLLEXPORT,ALIAS:"foomult" :: mult
works well and I can see foomult in java
Thanks so much,
Miguel

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page