lundi 23 mars 2015

Any error in second cpp file not recognised


I have 1 header file and 2 .cpp files (I've included main.cpp) and work on CodeBlocks. My problem is that compiler not see the errors in the second .cpp file (graph_interface.cpp) when I build it. Do you have any suggestions? Where am I going wrong?.


Simply I get the output even I did the wrong thing in graph_implementation.cpp file:



Target is up to date.
Nothing to be done (all items are up-to-date).


For example, my code in main.cpp



//main.cpp
#include "graph_interface.h"

int main(int argc,char *argv[])
{
return 0;
}


graph_interface.h file



#ifndef GRAPH_INTERFACE_H_INCLUDED
#define GRAPH_INTERFACE_H_INCLUDED

typedef struct{int v;int w;} Edge;
Edge EDGE(int,int);

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);
#endif // GRAPH_INTERFACE_H_INCLUDED


And other cpp file graph_implementation.cpp



#include "graph_interface.h"
using namespace std;
struct graph{
int V;
int E;
int **adj;
};
Graph GRAPHinit(int V){
Graph G=malloc(sizeof *G);
G->V=V;
G->E=0;
G->adj=MATRIXint(V,V,0);
return G;
;// not give anything
}



Aucun commentaire:

Enregistrer un commentaire