- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have legacy code that I am porting from VAX to PC (Win NT 4.0). I have several subroutine calls similar to the following:
call axis('axis label',10)
or
call axis(10Haxis label,10)
The subroutine axis is in a library that emulates VERSATEK
plotting calls and produces Postscript or HPGL plot files.
The subroutine looks like this:
subroutine axis(label,n)
dimension label(1)
return
end
The linker gives me the LNK2001 error on axis. To be compatible with many different legacy codes, I need to be able to call this routine with either form of the text argument. Is there any way to do this?
call axis('axis label',10)
or
call axis(10Haxis label,10)
The subroutine axis is in a library that emulates VERSATEK
plotting calls and produces Postscript or HPGL plot files.
The subroutine looks like this:
subroutine axis(label,n)
dimension label(1)
return
end
The linker gives me the LNK2001 error on axis. To be compatible with many different legacy codes, I need to be able to call this routine with either form of the text argument. Is there any way to do this?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compile with the options /iface:cref/iface:nomixed_str_len_arg (Project..Settings..Fortran..External Procedures: Argument Passing: C, By Ref, String length argument passing: After all args.)
In CVF (as in most UNIX and Windows compilers), character arguments are passed as two arguments, address and length, and in CVF, the length is passed immediately after the address (MS did it this way). The above options cause the lengths to be at the end (where your code doesn't see them) and causes the linker not to care about the mismatch in the number of arguments.
Steve
In CVF (as in most UNIX and Windows compilers), character arguments are passed as two arguments, address and length, and in CVF, the length is passed immediately after the address (MS did it this way). The above options cause the lengths to be at the end (where your code doesn't see them) and causes the linker not to care about the mismatch in the number of arguments.
Steve

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