You are here:

C/c problem

Advertisement


Question
Hello Sir! I am Pratibha doin my M.Tech project in turbo c/c++.
I have problem in creating library. i review my work shortly.
i have so many .cpp files n all files are using same data n functions almost, so i have taken a header file n declared all the data n functions.i m includin this header file in all necessary .cpp files n its working properly.but now i wan to merge all these .cpp files in a menu driven program using c library,when i m trying to build the library n compiling it is giving an error as "Function 'funname' clashes with prior module" i have taken extern datatype declaration.
Hope u ll reply soon.
Thank tou


Answer
I think, you are having different type of declaration for the same function, in different places.
Check and make sure that, the parameter types and return type matches with that of definition, at all the places of extern declarations.

Without looking at the code, this is all I can tell for now.

One resolution for this, is to have a single header file having all the declarations.
And definitions should be placed in a .c file.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.