- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am still relatively new to Fortran and am porting a mixed language program from IA32 to Intel64. In the original version, the C++ code makes calls to the Fortran using [C,ALIAS:'_nameOfSubroutine']. When the program tries to link under Intel64, all of these calls are listed as unresolved external symbols. I am assuming this has to do with the size of the address. Is there a way to implement this in the Intel64 platform?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it has to do with default name decoration conventions which are different on the 64-bit platform. Briefly, there is no leading underscore as there is on IA-32. If you drop the underscore, it should work.
If you want to write code that works on both platforms,. remove the MS PowerStation square bracket attribute syntax and add this line instead:
!DEC$ ATTRIBUTES C, DECORATE, ALIAS:"nameOfSubroutine" :: nameOfSubroutine
Ideally, I'd recommend using the new BIND(C,NAME="nameOfSubroutine") F2003 feature but a current compiler bug would result in the same problem you have now (because the compiler assumes the name you specify is fully decorated.) That will be fixed in the next update (or so I am told.)
If you want to write code that works on both platforms,. remove the MS PowerStation square bracket attribute syntax and add this line instead:
!DEC$ ATTRIBUTES C, DECORATE, ALIAS:"nameOfSubroutine" :: nameOfSubroutine
Ideally, I'd recommend using the new BIND(C,NAME="nameOfSubroutine") F2003 feature but a current compiler bug would result in the same problem you have now (because the compiler assumes the name you specify is fully decorated.) That will be fixed in the next update (or so I am told.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, problems solved.

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