c++ - Defined in discarded section error -
i have struct type defined in header file mystruct.h
struct mystruct {...};
.
then have declared 1 struct object in main as:
mystruct s;
and once in class header in same way.
this doesn't work, giving error:
`_zn10mystructc2ev' referenced in section `...myclass...' of.../module.pre.o: defined in discarded section `.text._zn10mystructc2ev[_zn10mystructc5ev]' of .../module.pre.o
if have struct in class works, need in main. how can solve?
define :
extern mystruct s;
in header file.
Comments
Post a Comment