Home > Back-end >  Have bosses know how to solve these two error, and attach a c file. H file
Have bosses know how to solve these two error, and attach a c file. H file

Time:01-05

 # include 
#include
# include "SeqList. H"

Typedef unsigned int TSeqListNode;
//the unsigned int renamed TSeqListNode

Typedef struct _tag_SeqList {
Int capacity;
int length;
TSeqListNode * node;
} TSeqList;
//define a structure, renamed TSeqList

SeqList * SeqList_Creat (int capacity) {
Ret TSeqList *=NULL;
If (capacity>=0) {
Ret=(TSeqList *) malloc (sizeof (TSeqList) + sizeof (TSeqListNode) * capacity);
}
if(ret!=NULL) {
Ret - & gt; Capacity=capacity;
Ret - & gt; Length=0;
Ret - & gt; The node=(TSeqListNode *) + 1 (ret);
}
return ret;
}
Void SeqList_Destroy (SeqList * list) {
Free (list);
}

Void SeqList_Clear (SeqList * list) {
TSeqList * slist=(TSeqList *) list;
If (slist!=0) {
Slist - & gt; Length=0;
}
}

Int SeqList_Length (SeqList * list) {
TSeqList * slist=(TSeqList *) list;
Int ret=1;
If (slist!=0) {
Ret=slist - & gt; Length;
}
return ret;
}

Int SeqList_Capacity (SeqList * list) {
TSeqList * slist=(TSeqList *) list;
Int ret=1;
If (slist!=0) {
Ret=slist - & gt; Capacity;
}
return ret;
}


 # # ifndef _SEQLIST_H_ 
# define _SEQLIST_H_

Typedef void SeqList;
Typedef void SeqListNode;

SeqList * SeqList_Create (int capacity);

Void SeqList_Destroy (SeqList * list);

Void SeqList_Clear (SeqList * list);

Int SeqList_Length (SeqList * list);

Int SeqList_Capacity (SeqList * list);

Int SeqList_Insert (SeqList * list, SeqListNode * node, int pos);

SeqListNode * SeqList_Get (SeqList * list, int pos);

SeqListNode * SeqList_Delete (SeqList * list, int pos);

# endif

Error 18 h: \ crossdev \ SRC \ mingw - w64 - v3 - SVN \ mingw - w64 - CRT \ CRT \ crt0_c c undefined reference to ` WinMain '
C: \ Users \ yhxc \ Desktop \ \ C language program list \ collect2 exe [Error] ld returned 1 exit status

CodePudding user response:

Didn't define the main function? ! Didn't see you in the source file to define the main function
  • Related