I have three file:
main.cpp:
#include <iostream>
#include "head.h"
using namespace std;
int main()
{
int a,b;
a=2;b=3;
int c=sum(a,b);
cout <<"c:"<<c<<endl;
return 0;
}
head.h:
#ifndef _HEAD_H_
#define _HEAD_H_
int sum(int a , int b);
#endif
head.c:
#include "head.h"
int sum(int a, int b)
{
return(a+b);
}
When I compile it, codeblocks give me the error: undefined error to function sum. And I have also included the path in Setting->Build Options->Search Directories->Compiler->Add. But still I get the error.