gcc Link problem

I have some crypting functions in object-file - for example,func.o
Main file,from where crypting functions called, named as main.cpp .
"gcc main.cpp -o main func.o" print "undefined reference to ... "
But if I rename main.cpp to main.c and execute
"gcc main.c -o main func.o" - ok. If anybody, what's wrong
in my actions please help, I'm really need .cpp file in project

i think that the word "gcc" compile only c file while your main.cpp file is a c++ file

Hi !!
Try this
g++ main.cpp -o main func.o
also plz use g++ even to link c code and allways qualify ur c-functions with -->
#ifdef __CPLUSPLUS
extern "C" {
#endif

<return type> function_name ([args if any]) {
// function body
}

#ifdef __CPLUSPLUS
}
#endif
This is to ensure that ur c-function never face name mangling while getting processed by c++ compiler.
regards
Sachin.

ooooooops iam sorry.
correct the compiling command to
g++ -o main main.cpp func.o
I promise such mistake wont come up from my side now.