'Uint' has not been declared ( Even with correct Header files )

Hello all! Hope you can help!

I can seem to figure out why this error is being thrown, everything seems in place.

Long story short, I am attempting to develop a game with SDL/OpenGL and I needed a good GUI/Widgets Library. I found Agar ( http://libagar.org/index.html.en ), but I cant seem to get the header files to compile correctly.

Ive got many errors stating that something hasn't been declared ( Uint, Ulong, etc ).

First Error Line in variable.h - error: ‘Uint’ has not been declared:

extern DECLSPEC int AG_InitCore(const char *, Uint);

However, at the top of variable.h, there is #include <agar/core/begin.h>
which has #include <agar/core/types.h> , which has:

1
2
3
#ifndef Uint
#define Uint unsigned int
#endif 

So im not sure what the problem is :(.

Im using Codeblocks 13.12 on Linux Mint 17.3 Cinnamon 64-bit
Last edited on
Try changing that block to
1
2
3
4
5
#ifndef Uint
#define Uint unsigned int
#else
#error
#endif  
Perhaps somebody else had defined it first.
Last edited on
Is that the first error message in the list? I don't think SDL or OpenGL defines Uint but if you want you could test to see if it makes a difference if you include all the Agar headers before (above) including the other headers.
Last edited on
Thanks helios and Peter87 for the quick replies!

@helios

I tried that block of code that you provided. It didn't halt on any errors and compiled as it did before :(.

@Peter87

I placed the SDL.h header before the Agar ones and it removed any errors relating to Uint32 ( and a few others ). However, Uint and some other defines remained undeclared and still spat out errors. I guess Uint32 was defined in the SDL Header.

-----

It seems the defines in the type.h file are just being 'skipped' during compilation. Code::Blocks highlights the 'define blocks' to be active.

One change I didn't mention was that I had to put a header guard inside types.h as I was getting 200 'redeclaration' errors.
Topic archived. No new replies allowed.