View topic - includes question



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: includes question
PostPosted: 16 Nov 2009, 17:01 
User avatar

Joined: 31 Oct 2009, 17:12
Location: Easton, MA
My apologies in advance, because I know that this is an ultra noob question to ask.

I run into problems sometimes when building Spring where it's a matter of a simple include file or #define that is missing from a source file. I assume that this is my environment since the developer who checked in the given change must have tested to make sure they could build.

For example, I recently pulled from latest via git, and in BaseNetProtocol.cpp, the following had been added as part of a larger change:

Code:
*packet << static_cast<uint16_t>(size) << reason;


This produced the following error:

Code:
error C2061: syntax error : identifier 'uint16_t'   e:\Projects\spring\rts\System\BaseNetProtocol.cpp   41


This made perfect sense since uint16_t was defined in System.h and that was not included, adding this include fixed the issue.

There are other examples of this as well, but, I didn't want to spam the forum with them.

My question is, am I doing something wrong here so that when someone checks in a change, I need to add these extra includes and defines to these various files?

Again, my apologies for the super-noobish question.

Mike


Top
 Offline Profile  
 
 Post subject: Re: includes question
PostPosted: 16 Nov 2009, 18:55 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
stuff like that may happen when using different build systems or compilers. most developpers use gcc on linux with CMake, though there are others.
i dont exaclty know how it hapens, could also have to do with precompiled headers and whatnot, but it is not cause you do something wrong. maybe system is included by an include in an included file or so, but if somethign from System.h is used in a .cpp file, then System.h should be included there, whether it is already included in an include or not.
so if stuff like this happens, commit it to your github forge of spring (if you do not habe one, make one) and then ask in #sy for a dev to have a look at it/include it into the main repo.


Top
 Offline Profile  
 
 Post subject: Re: includes question
PostPosted: 16 Nov 2009, 19:00 
User avatar

Joined: 31 Oct 2009, 17:12
Location: Easton, MA
Thanks hoijui,

I did get the impression from the forums that many people are building on Linux, which could be part of the issue as I am doing my builds on Windows XP and Windows 7 now.

In a way, it's a good experience. It helps me to figure this stuff out, I just wanted to make sure I wasn't missing some magic there somewhere. :-)


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.