PDA

View Full Version : How to remove Multiple 'maksbit' & 'mask' error!!



Krish
5th May 2008, 14:36
Hello! Friends,
I am getting this strange error as shown below when the both object files are linked to get the executable after make command: -


obj/Sample_func.o:Sample_func.cpp:(.data+0x20): multiple definition of `maskbit'

obj/Samplei.o:Sample.cpp:(.data+0x20): first defined here
obj/Sample_func.o:Sample_func.cpp:(.data+0xa0): multiple definition of `mask'
obj/Sample.o:Sample.cpp:(.data+0xa0): first defined here
collect2: ld returned 1 exit status

I mean am not able to see where the error is, so till now not able to solve it.:(

I know its not Qt question but C++ problem but,Can anyone please help me out in this and tell me on which line the error could be. I will be grateful.

Thanks in advance.

mitro
5th May 2008, 16:20
Could you provide the code of sample.cpp and sample_func.cpp files and their headers if any? You may have twice included the same header file that does not have include sentinels.