The open-source game engine and graphics engine for multiplayer, cross-platform, real-time 3D action

It is currently 2014-10-25, 01:48

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Noobish C++ question
PostPosted: 2012-05-17, 03:57 
Offline

Joined: 2012-05-11, 00:28
Posts: 42
Okay, I'd hoped to get a bit further before asking for help again, but it's been too long since I did any C++ programming at all...

I'm trying to add a function to the HumanPlayer class that will just (for now) change the StateOfExistance variable. I've updated HumanPlayer.hpp with the following:

Code:
...
    const btRigidBody* GetRigidBody() const { return m_RigidBody; }

    void BoardVehicle(); //  <---This is the new line

    // Implement the BaseEntityT interface.
    void TakeDamage(BaseEntityT* Entity, char Amount, const VectorT& ImpactDir);
    void ProcessConfigString(const void* ConfigData, const char* ConfigString);
...


At this point, everything still compiles and runs fine - other changes that I've made in the file take effect when they should with no issue. But when I change HumanPlayer.cpp to include the following:

Code:
...

void EntHumanPlayerT::Think(float FrameTime_BAD_DONT_USE, unsigned long ServerFrameNr)
{
    ...
}

void EntHumanPlayerT::BoardVehicle() {} //  <---This is the new line

void EntHumanPlayerT::ProcessEvent(char EventID)
{
    ....


..I get the following error:

Code:
g++ -o Games/DeathMatch/Code/build/linux2/g++/debug/HumanPlayer.os -c -g -funsigned-char -Wall -Werror -Wno-char-subscripts -fPIC -DDEBUG -DSCONS_BUILD_DIR=build/linux2/g++/debug -ILibs -IExtLibs -IExtLibs/bullet/src -IExtLibs/lua/src Games/DeathMatch/Code/HumanPlayer.cpp
Games/DeathMatch/Code/HumanPlayer.cpp:895:36: error: no 'void EntHumanPlayerT::BoardVehicle()' member function declared in class 'EntHumanPlayerT'
scons: *** [Games/DeathMatch/Code/build/linux2/g++/debug/HumanPlayer.os] Error 1
scons: building terminated because of errors.


Am I missing something obvious in the setup or declarations somewhere? Or should I look elsewhere for the culprit; like seeing if my editor is inserting extra characters?


Top
 Profile  
 
 Post subject: Re: Noobish C++ question
PostPosted: 2012-05-17, 09:50 
Offline
Site Admin
User avatar

Joined: 2004-08-19, 13:46
Posts: 1982
Location: Germany
Hi Stoo,

I cannot see anything that's obviously wrong, but the compiler error seems to indicate a typo in one of the files, or maybe a missing or additional bracket.

I'd check for such problems first. If it doesn't help, please post the complete files e.g. at pastebin, so that we can have a look.

_________________
Best regards,
Carsten


Top
 Profile  
 
 Post subject: Re: Noobish C++ question
PostPosted: 2012-05-18, 00:16 
Offline

Joined: 2012-05-11, 00:28
Posts: 42
:roll:

Looks like I'd managed to update the .hpp file in my project's directory (under Games), and the .cpp file under the Deathmatch branch - so the message was exactly right, it wasn't defined :P . I switched everything over, and now it looks like it's working fine.

Need a "smack my forehead" emoticon...

Thanks for the help!


Top
 Profile  
 
 Post subject: Re: Noobish C++ question
PostPosted: 2012-05-18, 00:20 
Offline
Site Admin
User avatar

Joined: 2004-08-19, 13:46
Posts: 1982
Location: Germany
You mean this one?
:wallb:

Good to hear you found the problem!
:cheesy:

_________________
Best regards,
Carsten


Top
 Profile  
 
 Post subject: Re: Noobish C++ question
PostPosted: 2012-05-18, 04:56 
Offline

Joined: 2012-05-11, 00:28
Posts: 42
:wallb:

Right... the "View more smilies" button... between missing the run directory in the instructions, this issue that started this topic, and missing that button, I'm beginning to wonder about the wisdom of jumping on this stuff right after work! :P

:wallb: :wallb:

Thanks again! :D


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group