Question

So, I have this c module in which I have modified two things: Added one parameter to a function and added one parameter to a struct.

The thing is that, when compiling using cc (from a script I inherited), I got error messsages wherever my changes are (Sorry if the translation is not exact):

error: too many arguments for 'function_that_I_added_the_argument'
error: struct 'struct_I_added_the_element' doesn't has a member called 'element_I_added'

I've checked several times the source files (Just if the script were calling an old version) but everything seems to be fine.

Right now I'm clueless. Any idea?

EDIT: Added part of the make per popular petition: Let be:

· the path to the files.

· module1.c the module where the function I modified is.

 cc -c //folder/module1.c -Wall -DLINUX -I/ -I//otherFolder -I//include -o //folder/module1.o

I haven't included source as it is as straightforward as a function and struct declaration can be: short int value; (for the struct) and function(params..., short param) for the function.

Was it helpful?

Solution

Two years later, I remembered to auto answer me and mark this as solved, so, copy paste from my own edit:

Solved:

Finally found the problems...

a) The project had declared two structs (struct petecander and struct structPetecander), and the compiler was telling me about "struct structPetecander" not having an element of structPetecander. Of course it didn't have it as it was another struct with a damn similar name.

b) I was getting a "too many arguments for function_that_I_added_the_argument". Too many time programming in Java made me forgot that in C you have to declare in a .h the function

Two error messages (buried below the other errors) gave me the hint. Sorry for the bad translation: /module.c:: error: conflict type for /headers.h:: error previous declaration of was here

Time to go to cry a bit to a corner, I guess.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top