- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have successfully compiled and linked a Windows 10 DLL with IFX 2024.0, and it is loaded by a third-party 64 bit program compiled with IFORT 19.0. The new IFX compiled DLL successfully has full access the the module variable and arrays in the IFORT 19 compiled program.
Calls from the DLL also work only if they contain numeric arguments, but not characters strings. It seems to be a clear pattern and the program crashes when the calls are made.
This naturally leads to questions what convention is being used for the hidden length argument of the character argument with both IFORT 19 and IFX 2024.
/iface:[no]mixed_str_len_arg
This directive exists in IFORT and is not documented in IFX /help. When set, the hidden length argument immediately follows the character string argument, otherwise it is appended to the list of call arguments.
IFX 2024.0 accepts this directive and may or may not do anything with it. I tried combinations with and without the 'no' toggle and the program crashes every time.
Are IFX 2024 and IFORT 19.0 compatible, and am I just not using it right, or is this a deficiency that needs to be fixed? Alternatively, do I need to download and and install IFORT 19. I haven't been able to find where to download it from. We currently have a license for IFORT 15.0.
Thanks. Dan.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reasoning that you applied appears to be sound, but the conclusions are incorrect. Here is a short test that you can do to see why.
Here is a test main program, which we can compile with IFort or Ifx, with or without the /iface:mixed_str_len_arg option.
program tmstrarg
implicit none
character s4*4, s5*5, s6*6
s4 = '4abc'
s5 = '5defg'
s6 = '6hijkl'
call sub(s4,s5,s6)
end program
Here is the subroutine, which we shall compile using an older Ifort compiler (I used Version 19.0.5.281) with the /iface:mixed_str_len_arg option:
subroutine sub(a,b,c)
character(len=*),intent(in) :: a,b,c
print 10,a,len(a),b,len(b),c,len(c)
10 format(1x,A,I2)
return
end subroutine
The result that I obtained with this procedure:
ifx /Od /MD tmstr.f90 ssub.obj
tmstr.exe
is an access violation (the calling conventions are mismatched).
If I repeat, using /iface:mixed_str_len_arg, this time, the output is what we expect:
4abc 4
5defg 5
6hijkl 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may want to contact the 3rd party that supplies the executable and file a bug report with them. They may know about compatibility with newer versions of ifort and ifx, and should be able to help you debug your specific issue.

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