Sign in to follow this  

error C2371

This topic is 4021 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

Hey... fo some reason, whenever i try to compile my program i keep getting this error now... 1>------ Build started: Project: game, Configuration: Debug Win32 ------ 1>Compiling... 1>main.cpp 1>c:\documents and settings\user\my documents\visual studio 2005\projects\game\game\tgaload.h(38) : error C2371: 'tgaHeader_t' : redefinition; different basic types 1> c:\documents and settings\user\my documents\visual studio 2005\projects\game\game\tgaload.h(38) : see declaration of 'tgaHeader_t' 1>c:\documents and settings\user\my documents\visual studio 2005\projects\game\game\tgaload.h(44) : error C2371: 'image_t' : redefinition; different basic types 1> c:\documents and settings\user\my documents\visual studio 2005\projects\game\game\tgaload.h(44) : see declaration of 'image_t' 1>Build log was saved at "file://c:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\game\game\Debug\BuildLog.htm" 1>CMPS2E21 - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I have absoltly no idea why, because i have changed nothing at all in these files.. If anyone could help me out id be reallt grateful

Share this post


Link to post
Share on other sites
Hmm, are you using include guards in all your headers?
Did you write those definitions yourself or are you just using them?
Did you define 'tgaheader_t' and 'image_t' somewhere else?

Share this post


Link to post
Share on other sites
These might be the cause:

1) tgaHeader_t is defined twice in your project

2) tgaload.h is included twice somehwere and it doesnt have something like:

#ifndef TGA_LOAD_H
#define TGA_LOAD_H
// Your header's content
#endif


3) tgaHeader_t is already defined in one of the other files that you have included (eg. a third party library)


(same reasoning for image_t)

Share this post


Link to post
Share on other sites

This topic is 4021 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