Sign in to follow this  

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

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

(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 :(

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this