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

Use of IFPORT and $MAXPATH does not work

lars1
Beginner
1,165 Views
Hi There
I am porting a CVF project to IVF but run into some problem
I have inserted USE IFPORT in my source code
and below in the code I have
USE DFLIB
CHARACTER($MAXPATH)BUFX
but the file does not compile I got the following message

D:Simpow_viewslars_10.2bugfix_viewsimpowsrc simpowm_wnty34072.f(25) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [$MAXPATH]
compilation aborted for D:Simpow_viewslars_10.2bugfix_viewsimpowsrc simpowm_wnty34072.f (code 1)
Any ideas ?
/Lars
0 Kudos
6 Replies
lars1
Beginner
1,165 Views

Hi

Sorry, It should of course be

USE IFPORT
CHARACTER($MAXPATH)BUFX
/Lars
0 Kudos
lars1
Beginner
1,165 Views

Hi again,

There was a typing msstakein my previous message .....

I have used the following code.

I have inserted USE IFPORT in my source code
and below in the code I have
USE IFPORT
CHARACTER($MAXPATH)BUFX
but the file does not compile I got the following message

D:Simpow_viewslars_10.2bugfix_viewsimpowsrc simpowm_wnty34072.f(25) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [$MAXPATH]
compilation aborted for D:Simpow_viewslars_10.2bugfix_viewsimpowsrc simpowm_wnty34072.f (code 1)
Any ideas ?
/Lars
0 Kudos
Steven_L_Intel1
Employee
1,165 Views
This works for me. Perhaps what you typed into the message is not the actual code. What happens when you compile the following program?
use ifport
character($MAXPATH) x
end
Also, what version of the compiler do you have? (8.0.???)
0 Kudos
lars1
Beginner
1,165 Views
Hi Steve,
I have tested a very simple code as below:
SUBROUTINE A1
USE IFPORT
CHARACTER BUF($MAXPATH)
END
And got the error below

Compiling...
ifort /nologo /Zi /Od /fpp /include:"....simpowsrcvers" /iface:cvf /iface:mixed_str_len_arg /module:"Debug/" /object:"Debug/" /traceback /libs:static /threads /dbglibs /winapp /c /extfor:f d:Simpow_viewslars_10.2bugfix_viewsimpowsimpow_wntsimpowSOURCE1.f
d:Simpow_viewslars_10.2bugfix_viewsimpowsimpow_wntsimpowSOURCE1.f(3) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [$MAXPATH]
CHARACTER BUF($MAXPATH)
--------------------^
compilation aborted for d:Simpow_viewslars_10.2bugfix_viewsimpowsimpow_wntsimpowSOURCE1.f
It seems to me that the "USE IFPORT" is NOT included in the code
Ihave the following fortran compiler
C:WINDOWSsystem32>ifort
Intel Fortran Compiler for 32-bit applications, Version 8.0 Build 20031017Z
Package ID: w_fc_p_8.0.035
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
Best Regards
/Lars
0 Kudos
Steven_L_Intel1
Employee
1,165 Views
Ok - you're using a very old compiler. Please update, if you can, to the current version (whch is 8.0.048). Your second example also works for me.
Do you realize that your second example declares an array of CHARACTER*1 elements?
0 Kudos
lars1
Beginner
1,165 Views

Hi Steve,

I have now installed the latest version of the compiler xxxx 047+ patch 048

And now I can compile without any problem

Thanks

/Lars

0 Kudos
Reply