Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
27113 Discussions

#5528 error when using kernel32 Win API Modules on Fortran Compiler 2021.1.1

ShinyaHattori
Novice
861 Views

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...)

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

Labels (1)
0 Kudos
1 Solution
mecej4
Black Belt
807 Views

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).

View solution in original post

5 Replies
mecej4
Black Belt
849 Views

The updated compiler (2021.1.2) compiles the test code with no error messages.

ShinyaHattori
Novice
831 Views

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

mecej4
Black Belt
808 Views

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).

ShinyaHattori
Novice
682 Views

OK. I'll use IFORT compiler driver (the "classic" driver) and I look forward to fixing the bug.

Steve_Lionel
Black Belt Retired Employee
657 Views

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.

 
Reply