| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 320 人关注过本帖
标题:编译时的一个错误,求教
只看楼主 加入收藏
camus924
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-10-27
收藏
 问题点数:0 回复次数:3 
编译时的一个错误,求教

很简单程序,却老是出现下面这个错误:
--------------------Configuration: try - Win32 Debug--------------------
Compiling...
Error spawning cl.exe

try1.obj - 1 error(s), 0 warning(s)

这是啥原因?

搜索更多相关主题的帖子: 编译 
2007-10-27 14:33
camus924
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-10-27
收藏
得分:0 
补充下,本人由于此问题重新装了次visual c++6.0
可问题依旧,这个错误是啥意思?怎么解决?
2007-10-27 15:08
hmxh1984
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-9-10
收藏
得分:0 

一个模拟操作系统处理进程的 程序  我找不到错误 请大家帮帮忙 找找谢了

//pcb.h

#ifndef PCB_H
#define PCB_H
using namespace std;

#ifndef NULL
const int NULL=0;
#endif
enum State{ready,run,stop};
enum bool{true,false};
struct PCB //进程控制块
{
int Pid; //进程ID
int Pri; //进程优先权
int Ptime; //需要处理的时间
State Pstate; //进程状态
PCB *next;
PCB(int id,int ri=3,int time=4,State state=ready,PCB *p=NULL) //构造函数
{
Pid=id;Pri=ri;Ptime=time;Pstate=state;next=p;
}
}
#endif //


//queue.h
#include<iostream>
#include"system.h"
#include"pcb.h"
using namespace std;

#ifndef NULL
const int NULL=0;
#endif
class PCBreadyqueue //进程就绪队列
{
public:
PCBreadyqueue(){head=new PCB;last=-1} //构造函数 实现
void insert(PCB p); //插入进程 函数
PCB *gethead(); // 取首地址
bool isempty(); //判空函数
friend class system; //操作系统类设为友员类
private:
PCB *head; //头结点
int last; //队列最后一个元素的位置 空队列 last 值为-1
}
void PCBreadyqueue::insert(PCB p)
{
PCB *current;
PCB *lcurrent;
current=head;
if(last==-1){current=&p;last++}
else
while(current->Pri>p.Pri)
{
lcurent=curent;
curent=curent->next;
}
p.next=curent;
lcurent=&p;
last++;
}

PCB *PCBreadyqueue::gethead()
{
return head;
}
bool PCBreadyqueue::isempty()
{
if(last==-1)return true;
return false;
}//


//system.h
#include<iostream>
#include"queue.h"
#include"pcb.h"
using namespace std;

#ifndef NULL
const int NULL=0;
#endif
class system //定义 操作系统 类
{
public:
void schedule(PCBreadyqueue que); //将进程队列递交的 函数
void runprocess(PCB *pi); //进程处理函数
void manageprocess(PCB *p); // 进程管理函数
}
void system::schedule(PCBreadyqueue que)
{
if(que.isempty()==false) //判队列是否空 不空就递交给 处理函数 否则就 输出 队列为空
{
runprocess(que.gethead());

}
else
cout<<"PCBreadyqueue is empty"<<endl;
}
void system::runprocess(PCB *pi) //处理函数只需把 PCB进程块交给 管理函数
{
PCB *current=new PCB;
current=pi;
while(current->next!=NULL)
{
PCB *lcurrent=new PCB;
lcurrent=current;
current=current->next;
head=current;
manageprocess(lcurrent);
}
manageprocess(current);
}
void system::manageprocess(PCB *p) //管理函数 计算进程以消耗的时间 将没有处理完的进程重新插到进程队列中
{
PCB*current=new PCB;
current=p;
current->Pri-=4;
current->Ptime-=2;
last=last-1;
PCB p1;
if(current->Ptime>0)
{
p1.Pid=current->Pid;
P1.Pri=current->Pri;
P1.Ptime=current->Ptime;
P1.Pstate=ready;
P1.next=NULL; //将进程块的指针域置空 重新插入队列
insert(p1);
}
delete p; //释放所有处理过的进程空间
}//


//main.cpp

#include"queue.h"
#include"system.h"
#include"pcb.h"
#include<iostream>
using namespace std;

void main()
{
system S;
PCBreadyqueue A;
PCB a[8];
for(int i=0;i++;i<8)
{
cin>>a[i].Pid>>a[i].Pri>>a[i].Ptime;
A.insert(a[i]);
}

S.schedule(A);
}//


杀 杀 人 跳 跳 舞
2007-10-27 16:49
hmxh1984
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-9-10
收藏
得分:0 
请大家 帮帮忙了 总找不到错误 

杀 杀 人 跳 跳 舞
2007-10-27 16:52
快速回复:编译时的一个错误,求教
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011333 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved