i have a objective-c program, i added a little lib with linked list in plain c.
this is the header:
typedef struct { int v; int w; } Edge;
Edge EDGE(int, int);
typedef enum tagTipoNodo {
k_casellaPolozia,
k_casellaKiller
} tipoNodo;
typedef struct node *link;
struct node { int v; link next; };
typedef struct node2v *link2v;
struct node2v { int v; int val; link2v next; };
link2v NEW2v(int v, int val, link2v next);
void DEL2v(int v, link2v *lista);
void Update2v(int v, int val, link2v lista);
link sort2x(link2v lista);
link sort2xDecr(link2v lista);
int maxInList(link2v lista);
struct graph { int V; int E; link *adj; int *tipo;};
typedef struct graph *Graph;
Graph GRAPHinit(int);
void GRAPHinsertE(Graph, Edge);
void GRAPHremoveE(Graph, Edge);
int GRAPHedges(Edge [], Graph G);
Graph GRAPHcopy(Graph);
void GRAPHdestroy(Graph);
void GRAPHShow(Graph G);
void ingr();
link nodeInDistance(Graph G, int A, int distance);
link nodeInDistanceOfType(Graph G, int A, int distance, tipoNodo tipo);
int distance(Graph G, int A, int B,tipoNodo tipo);
int shortestPath(Graph G, int A, int B, tipoNodo tipo, int *percorso);
link shortestPathList(Graph G, int A, int B, tipoNodo tipo);
int distanceForAllocation(Graph G, int A, int B, tipoNodo tipo);
void setPesoForNode(int n,int poliziotto);
void resetPesoForNode(int poliziotto);
void resetPesoForAllNodes();
void initCasPoliz();
link NEW(int v, link next);
void DEL(int v, link *lista);
link copyList(link l);
int lengthList(link l);
int lengthListOfType(Graph G,link l,tipoNodo tipo);
void deleteList(link *lista);
int isPresentInList(link lista,int val);
void printCaselleVietate();
in simulator all compiles well, but when i try to compile for device
this error occurs
link redeclared as different kind of symbol in…[…]
how can i fix this?
thanks
i have found that i have an #include “linkedList.h” in
helloworld.h and helloworld.m…
in simulator all went well…strange thing!
however another strange thing…:
in “linkedList.h” i have link and link2k defined in a similar way…but link2k does not gave me that error…mha!
use #import instead of #include. It’s main function is to remove the need to use header guards