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

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

ShinyaHattori
Novice
1,637 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/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

Labels (1)
0 Kudos
1 Solution
mecej4
Honored Contributor III
1,583 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
Honored Contributor III
1,625 Views

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

ShinyaHattori
Novice
1,607 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

0 Kudos
mecej4
Honored Contributor III
1,584 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
1,458 Views

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

0 Kudos
Steve_Lionel
Honored Contributor III
1,433 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