声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2921|回复: 2

[Fortran] fortran程序运行中出现的一个小问题!!!

[复制链接]
发表于 2007-9-1 20:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
warning LNK4084: total image size 1972436992 exceeds max (268435456); image may not run

这个在fortran里面出现,原因是什么?清高手给予指点,还有就是该怎样解决?
回复
分享到:

使用道具 举报

发表于 2007-9-1 21:19 | 显示全部楼层

回复 #1 fanghuikeer 的帖子

google一下就可以找到类似的问题,搜索的关键词为: “warning LNK4084: total image size  exceeds max ; image may not run”  (数字去掉,因为数字是跟你的程序有关的)


学成知识中心 (摘自:水木BBS)
发信人: nobusiness (无所事事), 信区: NumComp        
标  题: 在COMPAQ主页上找到的Large Image说明
发信站: BBS 水木清华站 (Fri Apr  6 17:57:18 2001)

Q1019 - Linker warning: "LNK4084 - total image size exceeds max (256MB); im
age may not run"
Platforms: All
Versions: All
Fixed in version: N/A
Article created: 08 June 1998
Article revised: 03 December 1998
Description: When linking an application which contains large arrays, the li
nker gives the warning "LNK4084 - total image size exceeds max (256MB); imag
e may not run".
Explanation: Windows 95 and Windows NT 4.0 have a limit for the total size o
f static code and data of 256MB.  If the amount of static code and data exce
eds this size, the image may not execute.  This is a limitation in the opera
ting system and not in Visual Fortran or its tools.  The most common cause o
f large static data is large local or COMMON arrays.
Solution: For Windows NT 4.0, install Microsoft's Windows NT Service Pack 3  
(or later).  This raises the limit on static code and data to 1.75GB.  Howev
er, the linker is not modified by this update and will continue to issue the
warning, which can be ignored.  The limit on Windows 98 is 1.75GB, the same
as Windows NT 4.0 with Service Pack 3.
For Windows 95, Microsoft has not released an update which raises the limit.

For either operating system, an alternative is to make the large arrays ALLO
CATABLE.   Dynamically allocated data is not subject to the 256MB limit.
Example #1: Local array
Old:
REAL BIG_ARRAY(1000,1000,500) !500MB
New:
REAL,ALLOCATABLE :: BIG_ARRAY(:,:,:)
...
ALLOCATE (BIG_ARRAY(1000,1000,500))
! ALLOCATE statement goes in executable
! part of program
Example #2: Common array
Old:
! Include file declaring COMMON array
REAL BIG_ARRAY(1000,1000,500) !500MB
New:
! New source file containing MODULE as follows
MODULE BIG_STUFF
REAL,ALLOCATABLE::BIG_ARRAY(:,:,:)
END MODULE BIG_STUFF
! Add to routines using BIG_ARRAY
USE BIG_STUFF
! Add to main program
USE BIG_STUFF
...
ALLOCATE (BIG_ARRAY(1000,1000,500)
Note that USE statements must immediately follow PROGRAM, SUBROUTINE or FUNC
TION statements.  For more information on MODULE, USE and ALLOCATABLE arrays
, see the Language Reference Manual.

--

※ 来源:·BBS 水木清华站 smth.org·[FROM: 162.105.73.66]
上一篇 返回上一页 回到目录 回到页首 下一篇
学成知识中心 (摘自:水木BBS)
发表于 2007-9-3 08:55 | 显示全部楼层
简单来说就是定义的数组过大,超过了256M的限制
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-10 23:43 , Processed in 0.049545 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表