Hi,
I have a strange problem regarding multiple decleration error:
At link time I get the following:
the error complains about sruct definitions (not as typedef) which are all located in a header file.linking libqhkp.so.1.0.0 (g++)
obj/moc_qhkp.o:(.bss+0x0): multiple definition of `et_hkp_drv_type'
obj/qhkp.o:(.bss+0x0): first defined here
obj/moc_qhkp.o:(.bss+0x4): multiple definition of `st_hkp_drv_act_out'
obj/qhkp.o:(.bss+0x4): first defined here
obj/moc_qhkp.o:(.bss+0x5): multiple definition of `st_hkp_drv_act_out_all'
obj/qhkp.o:(.bss+0x5): first defined here
obj/moc_qhkp.o:(.bss+0x7): multiple definition of `st_hkp_drv_act_in'
obj/qhkp.o:(.bss+0x7): first defined here
obj/moc_qhkp.o:(.bss+0x8): multiple definition of `st_hkp_drv_act_in_all'
The header file is gourded by the usual #ifndef _headerName_.
In addtion, note that the the second definition is in the moc file.
But I checked and the moc file has nowhere these sturct names in it... :confused:
I tried playing with the include order but that didn't help.
Any idea's how I can debug and sort this out?
The problem occurs only when I put the said header in my class header, and I have to, since I am using a memebr variable which is one of these structs.
If the header is used only in the implementation file of the class, it compiles and links ok.
(of course, I can't use that member variable then)
Qt4.2.1 SUSE10.1 .
Thanks.
Bookmarks