- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got a #5528 error when using kernel32 CreateDirectory and CopyFile on Intel Fortran Compiler 2021.1.1(w_oneAPI_2021.1.1.191).
But it worked in the Intel Visual Fortran Compiler 17.0.1.143.
Is this a bad code? Or is it a fortran bug like this?(https://community.intel.com/t5/Intel-Fortran-Compiler/USE-ADVAPI32-functions-in-openAPI-compiler/m-p/1257761)
The error and code are below.
Error
error #5528: The REFERENCE attribute cannot be used with a passed length CHARACTER variable on this platform
Code
program HelloIFX
use kernel32
implicit none
character(len=256) :: path_folder = "test"
integer(BOOL) :: ret_logi
integer :: ret
ret_logi = CreateDirectory(trim(path_folder)//""C, NULL)
ret = CopyFile("test.txt"C, "test2.txt"C, FALSE)
end program HelloIFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As described in the thread that you mentioned, the IFX compiler does have a bug in this regard. Please use the IFORT compiler driver (the "classic" driver).
Link Copied
- 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
Thank you for the update information.
I installed Intel Fortran Compiler(Beta) 2021.1.2[Intel(R) 64] , but it didn't work.
1>Compiling with Intel® Fortran Compiler (Beta) 2021.1.2 [Intel(R) 64]...
1>HelloIFX.f90
1>C:/~/HelloIFX/HelloIFX.f90(10): error #5528: The REFERENCE attribute cannot be used with a passed length CHARACTER variable on this platform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As described in the thread that you mentioned, the IFX compiler does have a bug in this regard. Please use the IFORT compiler driver (the "classic" driver).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK. I'll use IFORT compiler driver (the "classic" driver) and I look forward to fixing the bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should continue using ifort for general use. By all means, if you want to, give ifx a try and report any issues, but understand that ifx is not claimed to be ready for production use.

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