Skip to main content
gamedev.net
🔒 Locked

Wierd Compiler Error

Started by Xtreme 4 replies 2.8k views
Original Post
Xtreme
Xtreme
hi All, Just anyone have any idea as to WHY my program is coming up with the following error: C:\...\jmorecfg.h (161) : error C2371: ''INT32'' : redefinition; different basic types C:\...\INCLUDE\basetsd.h (33) : see declaration of ''INT32'' Error executing c1.exe main.obj - 1 error(s), 0 warning(s) This thing i have no idea! jmorecfg.h is one of several header files from the jpeg library. All it says is ''just copy the header file over to your directory and it will be included implicitly''.... yeah right!! I''ve tried almost everything including commenting out the offending code. Does anyone else come up with this similar problem? Its driving me insane arrrrrggggggghh! -Xtreme sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet
CobraA1
CobraA1
Two questions:

1. Which compiler are you using?

2. Which compiler is the JPEG library written for?

If you''re using Visual C++, and the library is written for GNU C++, you could run into troubles -- older versions of either compiler weren''t exactly up-to-date with the latest standards. They are now, but Visual C++ still has a lot of stuff designed only for Windows. That could lead to problems, also.

Make sure the library is written for the compiler you are using!



"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away"--Henry David Thoreau
SpazBoy_the_Mitey
SpazBoy_the_Mitey
hmm, I just looked at my basetsd.h from msvc++ ver 6, and it
has a line something like:

typedef int INT32, *PINT32;

now your error message:
C:\...\jmorecfg.h (161) : error C2371: ''INT32'' : redefinition; different basic types
C:\...\INCLUDE\basetsd.h (33) : see declaration of ''INT32''


means that somewhere in jmorecfg.h there is another typedef
for a data type being called INT32 that isn''t based on an int.

If you have the complete source to the library (ie: the .h and
all the .c/.cpp files) then you could do a find/replace on all
occurances of ''INT32'', changing them to something like ''INT32B''.

If you don''t have the source (ie: you have a .lib or .dll), then
perhaps you could (temporarily) comment out line #33 of basetsd.h

one of those should work.



----------
Disco Love For Everyone
----------"i think that all this talking and such is paining my head to astounding annoyance" - Erick"Quoting people in your tag is cool. Quoting yourself is even cooler" - SpazBoy_the_MiteyDisco Love For Everyone
Claus Hansen Ries
Claus Hansen Ries
INT32 is typedefined in both files, but not to the same.

this will result int the same error you have:

file1.h
typedef long int32;

file2.h
typedef unsigned long int32;


somewhere
include file1.h
include file2.h

Ries
Xtreme
Xtreme
CobraA1, i''m using VC++ V6 and the source was written so that it was portable for all platforms including VC++.

i''ve tried commenting the line in jmorecfg.h but that caused more errors!

Claus, I know what you mean there, but I''ve tried your method and that is why it is conflicting with basetsd.h file.

there are two typedef defined in 2 header files and they don''t seem to like each other. commenting one causes more compiler errors instead.

sig u say?
Yes! There are kangaroos in Australia but I haven't seen them...yet
SpazBoy_the_Mitey
SpazBoy_the_Mitey
show us the two typedef lines please.


----------
Disco Love For Everyone
----------"i think that all this talking and such is paining my head to astounding annoyance" - Erick"Quoting people in your tag is cool. Quoting yourself is even cooler" - SpazBoy_the_MiteyDisco Love For Everyone

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.