c语言程序的编译符号咋找不到了,C无法编译 – 架构x86_64找不到符号

我的C代码有一个严重的问题,我似乎似乎无法让它编译,我真的不知道为什么.

我已经尝试在线研究,找不到问题的解决方案,你有什么想法吗?

谢谢你的时间!

Undefined symbols for architecture x86_64:

"_Insert",referenced from:

_InsertNode in part1.o

(maybe you meant: _InsertNode)

"_Create",referenced from:

_findShortestPaths in part1.o

"_DeleteMin",referenced from:

_findShortestPaths in part1.o

"_decreaseKey",referenced from:

_findShortestPaths in part1.o

"_GetMin",referenced from:

_findShortestPaths in part1.o

ld: symbol(s) not found for architecture x86_64

collect2: ld returned 1 exit status

make: *** [part1] Error 1

来自part1.c的Snippits

#include "limits.h"

#include "pegBinaryHeap.h"

void InsertNode(int distance,Node* node,PriorityQueue PQ) {

...

Insert(*item,PQ);

}

...

int* findShortestPaths(Graph *graph,int start) {

...

//Priority queue ordered by distance

PriorityQueue pq = Create(graph->MaxSize);

for(int i = 0; i < graph->MaxSize; i++) {

...

}

//While the queue isn't empty:

while((currentPqItem=GetMin(pq)) != NULL) {

...

DeleteMin(pq);

//for each node accesable from currentNode

List *currentNeighbour = currentNode.outlist;

while(currentNeighbour!=NULL) {

...

decreaseKey(currentNode.id,newDistance,pq);

} // end for

}// end while

}

int main(int argc,char *argv[])

{

Graph mygraph;

return 0;

}

和它似乎在抱怨的.h文件

#include "graph.h"

struct HeapStruct;

typedef struct HeapStruct *PriorityQueue;

typedef struct {

int distance;

Node *node;

} QueueType;

PriorityQueue Create( int MaxSize );

void Destroy( PriorityQueue H );

int Insert( QueueType Item,PriorityQueue H );

QueueType DeleteMin( PriorityQueue H );

QueueType* GetMin( PriorityQueue H );

void decreaseKey(int nodeId,int value,PriorityQueue H);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值