i have GHostOne advanced remote host bot last version but i have some problems edditting it.
when i try to compile game.cpp (edited by me) gives me a lot of errors that i cannot solv (compile.txt file)
anyway...i cannot even compile the originat cpp file cuz he gives me a lot of errors too....so i think its my C++ compiler problems
i use Dev C++ compiler
what should i do?


PS: someone told me that i shall tri to compile again after i updat my libraries...is he right?

Attachments
Compiler: Default compiler

Executing  g++.exe...

g++.exe "C:\Dragos\GHostOne\ghost\game.cpp" -o "C:\Dragos\GHostOne\ghost\game.exe"    -I"C:\Dragos\Programe marpha\Dev C++\App\devcpp\lib\gcc\mingw32\3.4.2\include"  -I"C:\Dragos\Programe marpha\Dev C++\App\devcpp\include\c++\3.4.2\backward"  -I"C:\Dragos\Programe marpha\Dev C++\App\devcpp\include\c++\3.4.2\mingw32"  -I"C:\Dragos\Programe marpha\Dev C++\App\devcpp\include\c++\3.4.2"  -I"C:\Dragos\Programe marpha\Dev C++\App\devcpp\include"   -L"C:\Dragos\Programe marpha\Dev C++\App\devcpp\lib" 

In file included from C:\Dragos\GHostOne\ghost\/ghost.h:27,

                 from C:\Dragos\GHostOne\ghost\game.cpp:26:

C:\Dragos\GHostOne\ghost\/ms_stdint.h:33:2: #error "Use this header only with Microsoft Visual C++ compilers!"

In file included from C:\Dragos\GHostOne\ghost\/ghost.h:27,

                 from C:\Dragos\GHostOne\ghost\game.cpp:26:

C:\Dragos\GHostOne\ghost\/ms_stdint.h:69: error: conflicting declaration 'typedef char int8_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:27: error: 'int8_t' has a previous declaration as `typedef signed char int8_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:69: error: declaration of `typedef char int8_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:27: error: conflicts with previous declaration `typedef signed char int8_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:69: error: declaration of `typedef char int8_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:27: error: conflicts with previous declaration `typedef signed char int8_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:71: error: conflicting declaration 'typedef long int int32_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:31: error: 'int32_t' has a previous declaration as `typedef int int32_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:71: error: declaration of `typedef long int int32_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:31: error: conflicts with previous declaration `typedef int int32_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:71: error: declaration of `typedef long int int32_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:31: error: conflicts with previous declaration `typedef int int32_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:75: error: conflicting declaration 'typedef long unsigned int uint32_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:32: error: 'uint32_t' has a previous declaration as `typedef unsigned int uint32_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:75: error: declaration of `typedef long unsigned int uint32_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:32: error: conflicts with previous declaration `typedef unsigned int uint32_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:75: error: declaration of `typedef long unsigned int uint32_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:32: error: conflicts with previous declaration `typedef unsigned int uint32_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:89: error: conflicting declaration 'typedef int8_t int_fast8_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:50: error: 'int_fast8_t' has a previous declaration as `typedef char int_fast8_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:89: error: declaration of `typedef int8_t int_fast8_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:50: error: conflicts with previous declaration `typedef char int_fast8_t'

C:\Dragos\GHostOne\ghost\/ms_stdint.h:89: error: declaration of `typedef int8_t int_fast8_t'

C:/Dragos/Programe marpha/Dev C++/App/devcpp/include/stdint.h:50: error: conflicts with previous declaration `typedef char int_fast8_t'



C:\Dragos\GHostOne\ghost\game.cpp:52:32: boost/filesystem.hpp: No such file or directory

C:\Dragos\GHostOne\ghost\game.cpp:53:27: boost/regex.hpp: No such file or directory

C:\Dragos\GHostOne\ghost\game.cpp:55: error: `boost' has not been declared

C:\Dragos\GHostOne\ghost\game.cpp:55: error: expected namespace-name before ';' token

C:\Dragos\GHostOne\ghost\game.cpp:55: error: `<type error>' is not a namespace



C:\Dragos\GHostOne\ghost\game.cpp: In member function `virtual bool CGame::Update(void*, void*)':

C:\Dragos\GHostOne\ghost\game.cpp:353: error: no matching function for call to `CLanguage::HasPlayedDotAGamesWithThisBot2(std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string)'

C:\Dragos\GHostOne\ghost\/language.h:118: note: candidates are: std::string CLanguage::HasPlayedDotAGamesWithThisBot2(std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string)



C:\Dragos\GHostOne\ghost\game.cpp:3137:30: warning: multi-character character constant

C:\Dragos\GHostOne\ghost\game.cpp: In member function `virtual void CGame::EventPlayerBotCommand(CGamePlayer*, std::string, std::string)':

C:\Dragos\GHostOne\ghost\game.cpp:3137: warning:
/*

   Copyright [2008] [Trevor Hogan]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

   CODE PORTED FROM THE ORIGINAL GHOST PROJECT: http://ghost.pwner.org/

*/

//#include "stdio.h"
//#include "stdlib.h"
#ifdef WIN32
#include "dirent.h"
#endif
#include "ghost.h"
#include "util.h"
#include "config.h"
#include "language.h"
#include "socket.h"
#include "ghostdb.h"
#include "bnet.h"
#include "map.h"
#include "packed.h"
#include "savegame.h"
#include "replay.h"
#include "gameplayer.h"
#include "gameprotocol.h"
#include "game_base.h"
#include "game.h"
#include "stats.h"
#include "statsdota.h"
#include "statsw3mmd.h"

#include <cmath>
#include <string.h>
#include <time.h>
#ifdef WIN32
#include <windows.h>
#endif

#include <boost/filesystem.hpp>
#include <boost/regex.hpp>

using namespace boost :: filesystem;

//
// sorting classes
//

class CGamePlayerSortAscByPing
{
public:
	bool operator( ) ( CGamePlayer *Player1, CGamePlayer *Player2 ) const
	{
		return Player1->GetPing( false ) < Player2->GetPing( false );
	}
};

class CGamePlayerSortDescByPing
{
public:
	bool operator( ) ( CGamePlayer *Player1, CGamePlayer *Player2 ) const
	{
		return Player1->GetPing( false ) > Player2->GetPing( false );
	}
};

//
// CGame
//

CGame :: CGame( CGHost *nGHost, CMap *nMap, CSaveGame *nSaveGame, uint16_t nHostPort, unsigned char nGameState, string nGameName, string nOwnerName, string nCreatorName, string nCreatorServer ) : CBaseGame( nGHost, nMap, nSaveGame, nHostPort, nGameState, nGameName, nOwnerName, nCreatorName, nCreatorServer )
{
	m_DBBanLast = NULL;
	m_DBGame = new CDBGame( 0, string( ), m_Map->GetMapPath( ), string( ), string( ), string( ), 0 );

	if( m_Map->GetMapType( ) == "w3mmd" )
		m_Stats = new CStatsW3MMD( this, m_Map->GetMapStatsW3MMDCategory( ) );
	else if( m_Map->GetMapType( ) == "dota" )
		m_Stats = new CStatsDOTA( this );
	else
		m_Stats = NULL;

	m_CallableGameAdd = NULL;

	m_GameOverTime = 0;
	m_GameLoadedTime = 0;
	m_Server = nCreatorServer;
}

CGame :: ~CGame( )
{
	if( m_CallableGameAdd && m_CallableGameAdd->GetReady( ) )
	{
		if( m_CallableGameAdd->GetResult( ) > 0 )
		{
			CONSOLE_Print( "[GAME: " + m_GameName + "] saving player/stats data to database" );

			// store the CDBGamePlayers in the database

			for( vector<CDBGamePlayer *> :: iterator i = m_DBGamePlayers.begin( ); i != m_DBGamePlayers.end( ); i++ )
				m_GHost->m_Callables.push_back( m_GHost->m_DB->ThreadedGamePlayerAdd( m_CallableGameAdd->GetResult( ), (*i)->GetName( ), (*i)->GetIP( ), (*i)->GetSpoofed( ), (*i)->GetSpoofedRealm( ), (*i)->GetReserved( ), (*i)->GetLoadingTime( ), (*i)->GetLeft( ), (*i)->GetLeftReason( ), (*i)->GetTeam( ), (*i)->GetColour( ) ) );

			// store the stats in the database

			if( m_Stats )
			{
				m_Stats->Save( m_GHost, m_GHost->m_DB, m_CallableGameAdd->GetResult( ) );
				if (m_GHost->DBType == "mysql")
				if (m_GHost->m_UpdateDotaScoreAfterGame)
				{
					string formula = m_GHost->m_ScoreFormula;
					string mingames = m_GHost->m_ScoreMinGames;
					m_PairedCalculateScores.push_back( PairedCalculateScores( m_OwnerName, m_GHost->m_DB->ThreadedCalculateScores( formula, mingames ) ) );
				}
				else
				{
#ifdef WIN32
					if (m_GHost->m_UpdateDotaEloAfterGame)
						if (m_GHost->DBType == "mysql") 
						{
							system("update_dota_elo.exe");
						}
#endif
				}
			}
		}
		else
			CONSOLE_Print( "[GAME: " + m_GameName + "] unable to save player/stats data to database" );

		m_GHost->m_DB->RecoverCallable( m_CallableGameAdd );
		delete m_CallableGameAdd;
		m_CallableGameAdd = NULL;
	}

	for( vector<PairedBanCheck> :: iterator i = m_PairedBanChecks.begin( ); i != m_PairedBanChecks.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedBanAdd> :: iterator i = m_PairedBanAdds.begin( ); i != m_PairedBanAdds.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedRanks> :: iterator i = m_PairedRanks.begin( ); i != m_PairedRanks.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedCalculateScores> :: iterator i = m_PairedCalculateScores.begin( ); i != m_PairedCalculateScores.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedSafeAdd> :: iterator i = m_PairedSafeAdds.begin( ); i != m_PairedSafeAdds.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedSafeRemove> :: iterator i = m_PairedSafeRemoves.begin( ); i != m_PairedSafeRemoves.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedGPSCheck> :: iterator i = m_PairedGPSChecks.begin( ); i != m_PairedGPSChecks.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<PairedDPSCheck> :: iterator i = m_PairedDPSChecks.begin( ); i != m_PairedDPSChecks.end( ); i++ )
		m_GHost->m_Callables.push_back( i->second );

	for( vector<CDBBan *> :: iterator i = m_DBBans.begin( ); i != m_DBBans.end( ); i++ )
		delete *i;

	delete m_DBGame;

	for( vector<CDBGamePlayer *> :: iterator i = m_DBGamePlayers.begin( ); i != m_DBGamePlayers.end( ); i++ )
		delete *i;

	delete m_Stats;

	// it's a "bad thing" if m_CallableGameAdd is non NULL here
	// it means the game is being deleted after m_CallableGameAdd was created (the first step to saving the game data) but before the associated thread terminated
	// rather than failing horribly we choose to allow the thread to complete in the orphaned callables list but step 2 will never be completed
	// so this will create a game entry in the database without any gameplayers and/or DotA stats

	if( m_CallableGameAdd )
	{
		CONSOLE_Print( "[GAME: " + m_GameName + "] game is being deleted before all game data was saved, game data has been lost" );
		m_GHost->m_Callables.push_back( m_CallableGameAdd );
	}
}

bool CGame :: Update( void *fd, void *send_fd )
{
	// show score of 
	if (m_ShowScoreOf!="")
	{
//		CONSOLE_Print( "[GAME: " + m_GameName + "] checking score for "+ m_ShowScoreOf );		
		m_PairedDPSChecks.push_back( PairedDPSCheck( "%", m_GHost->m_DB->ThreadedDotAPlayerSummaryCheck( m_ShowScoreOf, m_GHost->m_ScoreFormula, m_GHost->m_ScoreMinGames ) ) );
		m_ShowScoreOf=string();
	}
	
	// update callables

	for( vector<PairedBanCheck> :: iterator i = m_PairedBanChecks.begin( ); i != m_PairedBanChecks.end( ); )
	{
		if( i->second->GetReady( ) )
		{
			CDBBan *Ban = i->second->GetResult( );

			if( Ban )
				SendAllChat( m_GHost->m_Language->UserWasBannedOnByBecause( i->second->GetServer( ), i->second->GetUser( ), Ban->GetDate( ), Ban->GetAdmin( ), Ban->GetReason( ) ) );
			else
				SendAllChat( m_GHost->m_Language->UserIsNotBanned( i->second->GetServer( ), i->second->GetUser( ) ) );

			m_GHost->m_DB->RecoverCallable( i->second );
			delete i->second;
			i = m_PairedBanChecks.erase( i );
		}
		else
			i++;
	}

	for( vector<PairedBanAdd> :: iterator i = m_PairedBanAdds.begin( ); i != m_PairedBanAdds.end( ); )
	{
		if( i->second->GetReady( ) )
		{
			if( i->second->GetResult( ) )
			{
				for( vector<CBNET *> :: iterator j = m_GHost->m_BNETs.begin( ); j != m_GHost->m_BNETs.end( ); j++ )
				{
					if( (*j)->GetServer( ) == i->second->GetServer( ) )
						(*j)->AddBan( i->second->GetUser( ), i->second->GetIP( ), i->second->GetGameName( ), i->second->GetAdmin( ), i->second->GetReason( ) );
				}

//				SendAllChat( m_GHost->m_Language->PlayerWasBannedByPlayer( i->second->GetServer( ), i->second->GetUser( ), i->first ) );
			}

			m_GHost->m_DB->RecoverCallable( i->second );
			delete i->second;
			i = m_PairedBanAdds.erase( i );
		}
		else
			i++;
	}

	for( vector<PairedRanks> :: iterator i = m_PairedRanks.begin( ); i != m_PairedRanks.end( ); )
	{
		if( i->second->GetReady( ) )
		{
			string Scores = i->second->GetResult();
			if (Scores.length()>160)
				Scores = Scores.substr(0,160);
			SendAllChat(Scores);

			m_GHost->m_DB->RecoverCallable( i->second );
			delete i->second;
			i = m_PairedRanks.erase( i );
		}
		else
			i++;
	}

	for( vector<PairedCalculateScores> :: iterator i = m_PairedCalculateScores.begin( ); i != m_PairedCalculateScores.end( ); )
	{
		if( i->second->GetReady( ) )
		{
			bool ok = i->second->GetResult();
			if (ok)
				SendAllChat("Scores have been calculated");

			m_GHost->m_DB->RecoverCallable( i->second );
			delete i->second;
			i = m_PairedCalculateScores.erase( i );
		}
		else
			i++;
	}

	for( vector<PairedSafeAdd> :: iterator i = m_PairedSafeAdds.begin( ); i != m_PairedSafeAdds.end( ); )
	{
		if( i->second->GetReady( ) )
		{
			if( i->second->GetResult( ) )
			{
				for( vector<CBNET *> :: iterator j = m_GHost->m_BNETs.begin( ); j != m_GHost->m_BNETs.end( ); j++ )
				{
					if( (*j)->GetServer( ) == i->second->GetServer( ) )
						(*j)->AddSafe( i->second->GetUser( ));
				}
				SendAllChat(m_GHost->m_Language->AddedPlayerToTheSafeList(i->second->GetUser( )));
			} else
				SendAllChat("Cannot add"+i->second->GetUser( )+" to safelist.Close the database.");

			m_GHost->m_DB->RecoverCallable( i->second );
			delete i->second;
			i = m_PairedSafeAdds.erase( i );
		}
		else
			i++;
	}

	for( vector<PairedSafeRemove> :: iterator i = m_PairedSafeRemoves.begin( ); i != m_PairedSafeRemoves.end( ); )
	{
		if( i->second->GetReady( ) )
		{
			if( i->second->GetResult( ) )
			{
				for( vector<CBNET *> :: iterator j = m_GHost->m_BNETs.begin( ); j != m_GHost->m_BNETs.end( ); j++ )
				{
					if( (*j)->GetServer( ) == i->second->GetServer( ) )
						(*j)->RemoveSafe( i->second->GetUser( )

Ask the person you got the source from what compiler they used, then get that compiler and use it to compiler. OR look through the errors, try and fix them. For example: In Visual Studio you write:

sprintf_s();

but in dev C++ that will return an error. It must be replaced with

sprintf();

also that cpp file doesn't help us at all because it has a ton of includes that are not included. Most of the errors are probably in those includes.

I looked through the errors and it looks like it was originally compiled on visual studio.

There is a message in that compile.txt file that states it must be compiled with VC++ 2008 (probably express edition will be ok).

yea i know in microsoft visual studio c++ expres eddition i may resolve my problems but i don't know how to compile in that program:D...please tell me how

i found out how to compile in microsoft visual c++ expres edition but now i have another problem....i cannot compile/build any file becose gives me this error :


1>------ Build started: Project: ghost, Configuration: Debug Win32 ------
1>Embedding manifest...
1>mt.exe : general error c10100b1: Failed to load file "..\Debug\ghost.exe". The system cannot find the path specified.
1>Build log was saved at "file://c:\Dragos\Project\ghost\ghost\Debug\BuildLog.htm"
1>ghost - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
anyway....if i tri to compile the original game.cpp file gives me the same error...so i think my visual c++ misses 1 file
if that isnt the problem tell me what is and how to resolve it pls

zip up the entire project and attach it to your post so that we can try to compile/link it ourselves. Please delete all compiler-generated files, such as *.obj and *.ncb to that the zip file is smaller.

i have only edited the game.cpp(GhostOne/ghost/game.cpp) file and the game_base.cpp(GhostOne/ghost/game_base.cpp)

also this program its not made by me...i have only downloaded and tried to edit it

and thx for help by the way

i cannot post the file....
Invalid Post specified. If you followed a valid link, please notify the administrator
this is what tells me after i attach file ...i think thi file size its too big (18MB)

he told me to post the whole program so he can try to compile it...welll the whole programe has 18MB

he told me to post the whole program so he can try to compile it...welll the whole programe has 18MB

Go back and re-read my post. I said to delete all compiler-generated files.

I downloaded that zip file and tried to compile it with VC++ 2008 Express but some errors on bncsutil library (its not on my computer). Where do I get it ?

dont rlly know...told ya i am noob in this thing

You will have to get that library before you can attempt to compile the program you posted. google for it and see if that will find it.

man sry for disturbing...i have fount a readme file in the directory where is my program instaled that tells you how to compile it...
thx for all

This question has already been answered. Start a new discussion instead.