(441) : error C2084: function '__thiscall ZHULOADZX::ZHULOADZX(void)' already has a b
(441) : error C2084: function '__thiscall ZHULOADZX::ZHULOADZX(void)' already has a body
everything was running smoothly when i was doing the hardest part of my engine(i think), loading of the animated x files
im using visual c ++ and im making a directx engine
and this initializer function has no body else where anywhere
and i need to initialize some things,
but im not realy sure anyone wants to see 800 lines of code,
but ill post it if someone requests it
everything else was compiling smoothly :) and this is the only thing thats haulting progress :(
i guess id also say that the class definitions and then the supplied functions in trying to put them all in this header file to be tidy and bundled since im making an easy to use engine
If it says that your function already has a body then it does have a body already. THis could be caused by including a file twice. Make sure all of your header files have include guards.
oooooooo
whats an include guard?
theres also a macro redefinition that happened, that isnt happening in the file that the data for loading my animated x files came from, and im using less code then it,
whats an include guard?
ive never heard of an include guard.
whats an include guard?
theres also a macro redefinition that happened, that isnt happening in the file that the data for loading my animated x files came from, and im using less code then it,
whats an include guard?
ive never heard of an include guard.
This error can come for multiple reasons:
- you don't have correct include guard(ian?)s
- you don't have asked for a default constructor in your ZHULOADZX class, but you define one.
- you're defining the constructor in a header file, but you forgot the inline keyword before the definition.
- you really are defining the constructor twice.
- you don't have correct include guard(ian?)s
- you don't have asked for a default constructor in your ZHULOADZX class, but you define one.
- you're defining the constructor in a header file, but you forgot the inline keyword before the definition.
- you really are defining the constructor twice.
Why are u putting everything in the .h file? If you are designing an engine i would suggest to keep the meat of ur functions on a CPP.. Ideally once everything is running well, someone else only needs the function declarations from ur headers to use ur engine.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement