
vc下 源文件连接错误
--------------------Configuration:pcb-Win32Debug--------------------Linking...LIBCD.l...
--------------------Configuration: pcb - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/pcb.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
pcb.exe - 1 error(s), 0 warning(s)
#include"stdlib.h"
#include"stdio.h"
#define N 10
#define LEN sizeof(stru_pcb)
struct stru_pcb
{
long int pid;
int status;
int priority;
char resource_list[20];
char createdatetime[10];
char note[100];
struct stru_pcb *next;
};
typedef struct stru_pcb *LIST;
int initial(LIST h)
{
if((h=(LIST)malloc(LEN))==NULL)return(0);
h->next=NULL;
return(1);
}
LIST insert_proccess_to(LIST h)
{
LIST node;
if((node=(LIST)malloc(LEN))==NULL)return(0);
printf("pid:");
scanf("%l",node->pid);
printf("status:");
scanf("%d",node->status);
printf("priority:");
scanf("%d",node->priority);
printf("resource list:");
gets(node->resource_list);
printf("create date time:");
gets(node->createdatetime);
printf("note:");
gets(node->note);
node->next=h->next;
h->next=node;
return h;
}
void mian()
{
int flag=1;
LIST Stru_pcb=NULL; //定义进程块pbc
initial(Stru_pcb); //初始化表pbc
while(flag<=N) //插入进程
{
insert_proccess_to(Stru_pcb);
}
} 展开
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/pcb.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
pcb.exe - 1 error(s), 0 warning(s)
#include"stdlib.h"
#include"stdio.h"
#define N 10
#define LEN sizeof(stru_pcb)
struct stru_pcb
{
long int pid;
int status;
int priority;
char resource_list[20];
char createdatetime[10];
char note[100];
struct stru_pcb *next;
};
typedef struct stru_pcb *LIST;
int initial(LIST h)
{
if((h=(LIST)malloc(LEN))==NULL)return(0);
h->next=NULL;
return(1);
}
LIST insert_proccess_to(LIST h)
{
LIST node;
if((node=(LIST)malloc(LEN))==NULL)return(0);
printf("pid:");
scanf("%l",node->pid);
printf("status:");
scanf("%d",node->status);
printf("priority:");
scanf("%d",node->priority);
printf("resource list:");
gets(node->resource_list);
printf("create date time:");
gets(node->createdatetime);
printf("note:");
gets(node->note);
node->next=h->next;
h->next=node;
return h;
}
void mian()
{
int flag=1;
LIST Stru_pcb=NULL; //定义进程块pbc
initial(Stru_pcb); //初始化表pbc
while(flag<=N) //插入进程
{
insert_proccess_to(Stru_pcb);
}
} 展开
展开全部
呵呵,不是子系统的问题。原来是你main()函数名字写错了,该过来就好了
void mian() // 名字错误了,应该main
{
int flag=1;
LIST Stru_pcb=NULL; //定义进程块pbc
initial(Stru_pcb); //初始化表pbc
while(flag<=N) //插入进程
{
insert_proccess_to(Stru_pcb);
}
}
void mian() // 名字错误了,应该main
{
int flag=1;
LIST Stru_pcb=NULL; //定义进程块pbc
initial(Stru_pcb); //初始化表pbc
while(flag<=N) //插入进程
{
insert_proccess_to(Stru_pcb);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询