uint

Started by
5 comments, last by roos 18 years, 8 months ago
Hi, I am working on a project with a bunch of other guys on a cross-platform game... They're all using Linux to develop, but since I'm having trouble setting up my wireless USB network adapter, for the time being I'm trying to develop in Windows. However when I compile I get a bunch of errors saying that "uint" is undefined. So, does anyone know if "uint" is a standard type on some compilers like GCC? If so then I'll just add some code like this:

#ifdef _MSVC_IS_BEING_USED   (or something like that)
typedef unsigned int  uint;
#endif
Thanks, roos
Advertisement
uint isn't a standard type according to the C or C++ standards. Someone probably forgot to include a header that had it typedef'd.
Ra
If they forgot to include some header, wouldn't the code fail to compile for them too? (I checked out the code fresh from the CVS repository, so there's no doubt that it compiles.) Somehow, uint is defined for their compiler and I'm just a bit confused as to where it's "coming" from. My guess is that it's something specific to GCC, so I just have to add some #ifdef/#endif so it is defined for VC++ as well.
It might be something with GCC, but I doubt it.

This is why you always run compilers in anal mode, to prevent any extensions from getting in. [wink]

It'd probably be best to just ask the other guys where uint is defined.
Ra
Seems like you can use uint in gcc. I found this out when typedefing it in a header, and then forgot to include that header where I used it [smile]. This compiled fine on linux, but didn't work in windows, even though I used Dev-C++ which to my knowledge is also using gcc. So it seems like you can use uint with gcc on linux, which is a bit weird in my opinion. Well, just wanted you to know.
You can also set up paths to automatically include headers in gcc. Perhaps theyve done that locally??

IE, Around here we manually hardcode a path to our MS Platform SDK so each person can put it where they want.

The acutal make file doesn't refere to its location so the compiler and linker use the personal settings.

Cheers
Chris
CheersChris
Cool, thanks for the info guys... I guess I will just add a typedef to a header that all the files can include.

roos

This topic is closed to new replies.

Advertisement