error C2371

Started by
1 comment, last by Vich 17 years, 4 months ago
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
Advertisement
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?
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)
[www.LifeIsDigital.net - My open source projects and articles.

This topic is closed to new replies.

Advertisement