• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Error while compiling.

Nothxbye

Banned User
Joined
Jan 22, 2012
Messages
1,124
Reaction score
174
Hello otlanders,

I've got this error when i trying to compile on visual studio, what is wrong?
Code:
1>  weapons.cpp
1>  waitlist.cpp
1>  vocation.cpp
1>  trashholder.cpp
1>  tools.cpp
1>  tile.cpp
1>  thing.cpp
1>  teleport.cpp
1>  tasks.cpp
1>  talkaction.cpp
1>  status.cpp
1>  spells.cpp
1>  spawn.cpp
1>  sha1.cpp
1>  server.cpp
1>  scriptmanager.cpp
1>  scheduler.cpp
1>  rsa.cpp
1>  raids.cpp
1>  protocollogin.cpp
1>  Generating Code...
1>  Compiling...
1>  protocolgame.cpp
1>  protocol.cpp
1>  position.cpp
1>  player.cpp
1>  party.cpp
1>  outputmessage.cpp
1>  outfit.cpp
1>  otserv.cpp
1>  otpch.cpp
1>  npc.cpp
1>  networkmessage.cpp
1>  movement.cpp
1>  monsters.cpp
1>  monster.cpp
1>  md5.cpp
1>  map.cpp
1>  mailbox.cpp
1>  luascript.cpp
1>  logger.cpp
1>c:\users\user\desktop\newestsource\newest source\logger.cpp(71): error C3861: 'time': identifier not found
1>  items.cpp
1>  Generating Code...
1>  Compiling...
1>  item.cpp
1>  ioplayer.cpp
1>  iomapxml.cpp
1>  iomapserialize.cpp
1>  iomapotbm.cpp
1>  ioaccount.cpp
1>  housetile.cpp
1>  house.cpp
1>  globalevent.cpp
1>  game.cpp
1>  fileloader.cpp
1>  exception.cpp
1>  depot.cpp
1>  databasesqlite.cpp
1>  databasemysql.cpp
1>c:\users\user\desktop\newestsource\newest source\databasemysql.cpp(195): error C2440: 'initializing' : cannot convert from 'MySQLResult *' to 'DBResult *'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>  database.cpp
1>  cylinder.cpp
1>  creatureevent.cpp
1>  creature.cpp
1>  container.cpp
1>  Generating Code...
1>  Compiling...
1>  connection.cpp
1>  configmanager.cpp
1>  condition.cpp
1>  commands.cpp
1>  combat.cpp
1>  chat.cpp
1>  beds.cpp
1>  baseevents.cpp
1>  ban.cpp
1>  allocator.cpp
1>  actions.cpp
1>  account.cpp
1>c:\users\user\desktop\newestsource\newest source\account.cpp(43): error C3861: 'time': identifier not found
1>c:\users\user\desktop\newestsource\newest source\account.cpp(47): error C3861: 'time': identifier not found
1>  Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

- - - Updated - - -

Bump, maybe i forgot show logger.cpp:
Code:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
// Logger class - captures everything that happens on the server
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////

#include "otpch.h"

#include "logger.h"
#include <iostream>
#include "tools.h"
/*
void Logger::logMessage(std::string channel, eLogType type, int level,
			std::string message, std::string func,
			int line, std::string file)
{
	std::string sType;
	switch(type){
	case LOGTYPE_ERROR:
			sType = "error";
			break;
	case LOGTYPE_EVENT:
			sType = "event";
			break;
	case LOGTYPE_WARNING:
			sType = "warning";
}
	std::cout << "Channel: " << channel << std::endl;
	std::cout << "Type: " << sType << std::endl;
	std::cout << "Level: " << level << std::endl;
	std::cout << "Message: " << message << std::endl;
	std::cout << "Func: " << func << std::endl; 
	std::cout << "Line: " << line << std::endl; 
	std::cout << "File: " << file << std::endl; 
}
*/

Logger::Logger()
{
	m_file = fopen("otlog.txt", "a");
}

Logger::~Logger()
{
	if(m_file){
		fclose(m_file);
	}
}

void Logger::logMessage(const char* channel, eLogType type, int level, std::string message, const char* func)
{
	//TODO: decide if should be saved or not depending on channel type and level
	// if should be save decide where and how
	
	//write timestamp of the event
	char buffer[32];
	time_t tmp = time(NULL);
	formatDate(tmp, buffer);
	fprintf(m_file, "%s", buffer);
	//write channel generating the message
	if(channel){
		fprintf(m_file, " [%s] ", channel);
	}

	//write message type
	const char* type_str;
	switch(type){
	case LOGTYPE_EVENT:
		type_str = "event";
		break;
	case LOGTYPE_WARNING:
		type_str = "warning";
		break;
	case LOGTYPE_ERROR:
		type_str = "ERROR";
		break;
	default:
		type_str = "???";
		break;
	}
	fprintf(m_file, " %s:", type_str);
	//write the message
	fprintf(m_file, " %s\n", message.c_str());

	fflush(m_file);
}
 
Last edited:
Back
Top