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.

ankitbehera2670

My problem is solved. It looks like the problem was related to the installation of code blocks but I was able to get the desired result after uninstalling and reinstalling codeBlocks. However the following are the details:

I am running codeBlocks 16.01 on ubuntu 16.04.9. The compiler I use is g++ version 5.4.0.I have 3 files that I want to compile: main.cpp head.h head.cpp.I had created a new empty project in codeblocks and then I had created these 3 files within codeblocks. I have also set the path in Setting->Build Options->Search Directories->Compiler->Add. However when I click the Build and Run button, codeblocks gives me the error that "Undefined reference to function 'sum(int, int)' ".

nice that it works... But for the next time: In the link is clearly described that we need a full rebuild log. Without this log it is impossible to help. Can people not read and follow instructions nowadays?

nice that it works... But for the next time: In the link is clearly described that we need a full rebuild log. Without this log it is impossible to help. Can people not read and follow instructions nowadays?