(441) : error C2084: function '__thiscall ZHULOADZX::ZHULOADZX(void)' already has a b

Started by
5 comments, last by Jedite 19 years, 8 months ago
(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 :(
"am i supposed to be able to do sh_t with this?" oink snort
Advertisement
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
"am i supposed to be able to do sh_t with this?" oink snort
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.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
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.
"am i supposed to be able to do sh_t with this?" oink snort
never mind ill just go read about it
"am i supposed to be able to do sh_t with this?" oink snort
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.
- AdMiRaLP.S. sorry, I'm french, so i may not always speak english perfectly.
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