Apparently you already have another function called func somewhere.
The extern also shouldn't be there.
Are you perhaps including the file you showed here in main.cpp?
Athar, I have checked everywhere in the code for the function func . but i find it no where other then the defination in this file and calling of the function in the main .
Also i have included this file in the main.
Yeah, that's the problem. Now func exists in two modules: in main.cpp and the included file.
You need to include the header file instead of the .cpp file. The header file should just contain forward declarations that tell the compiler that the function is defined in some other module.