24小时热门版块排行榜    

查看: 1704  |  回复: 17
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

小桥流水1102

新虫 (初入文坛)

[求助] c++ 程序编译出错 内存不足 已有2人参与

c++ 程序, 定义Max为10000时,可以编译成功,定义其为1.2 万或更大时,编译出错,报错信为  (.text+0x67): relocation truncated to fit: R_X86_64_32 against symbol `filename_luna' defined in .bss section in /tmp/icpcoQx3ZW.o。。。

使用 g++ -mcmodel=large  666.cpp 可以编译成功,但不能运行 编译后的可执行程序,报错信息为Killed。

求大神指点下。谢谢


c++ 程序 如下:

const int    Max = 10000;
const double rfac=1.25;
struct coordi
{
    string name;
    double x;
    double y;
    double z;
};
typedef pair<int,double>tw;
string filename_luna;
string filename_xyz,filename_out, filename_tem;

int n;
coordi coo1[Max];
vector<tw> QQ[Max];      
vector<int> pis[Max];  
int n_dan;
bool vis[Max];
bool visited[Max];

double dist[Max][Max];
double rdist[Max][Max];
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

chenshuai000

金虫 (正式写手)

5楼2016-01-25 08:17:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 18 个回答

chenshuai000

金虫 (正式写手)

2楼2016-01-24 22:54:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

chenshuai000

金虫 (正式写手)

3楼2016-01-24 22:57:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

小桥流水1102

新虫 (初入文坛)

引用回帖:
3楼: Originally posted by chenshuai000 at 2016-01-24 22:57:16
是stack overflow么?

感觉是的。由什么对策吗?
c++ 不大懂, 为什么采用 g++ -mcmodel=large  666.cpp 可以编译成功?
4楼2016-01-24 23:15:11
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见