Postado Maio 14, 2014 11 anos Este é um post popular. DEV C++, aprenda a compila uma source TFS! Downloads(Baixe de acordo as configurações do seu windows): DEV C++ CONFIGURADO PARA 32BITS DEV C++ CONFIGURADO PARA 64BITS REV 3884 TFS 0.4 Certo, feitos os downloads, extrai DEV C++ no Disco C e REV 3884 em Documentos. ====================================== Abra o DEV C++: ====================================== ====================================== Abra a Source: ====================================== ====================================== Localize a pasta da Source e abra o arquivo TheForgottenServer.dev, Documentos> trunk.r3884> dev-cpp> TheForgottenServer.dev: ====================================== ============================================================= ====================================== Aguarde carregar todos os arquivos: ====================================== ====================================== Vamos adicionar o parâmetro -D__CONSOLE__ no teclado digita ALT + P, clique em parameters e adicione o parâmetro... Feito? clique em OK: ====================================== ====================================== Vamos compilar Source, no teclado digite CTRL+F9 e aguarde finalizar o processo: ====================================== ====================================== Se der tudo certo em Log vai estar como mostra a imagem abaixo: ====================================== ====================================== Verifique na pasta Documentos> trunk.r3884> dev-cpp você vai encontrar o arquivo TheForgottenServer.exe e pronto meu parabéns você compilou! ====================================== =========================================== Só isso galera tutorial rápido resumido e útil! Créditos Natanael Beckman! =========================================== Caso você adquira uma source com apenas os arquivos .cpp e .h e não sabe como compilar o projeto, abaixo vamos explicar: Na pasta onde está localizado os arquivos .cpp e .h crie uma pasta chamada dev-cpp, e dentro dela adicione uma imagem icone. Abra o DEV-C++, clique em File> New> Project: Logo em seguida selecione Empty Project, em name terá o nome Project1 altere utilize o nome quer quiser, após isso clique em OK e em seguida selecione a pasta dev-cpp que criamos: Agora selecione a opção Win32GUI caso use source OTX ou TFS selecione Win32Console ao lado << Browse selecione a imagem do icone que está na pasta Dev-Cpp. No mesmo menu na aba Parameters em C++ compiler adicione os seguintes parâmetros: -D__ENABLE_SERVER_DIAGNOSTIC__ -D__ROOT_PERMISSION__ -D__GROUND_CACHE__ -D__USE_SQLITE__ -D__USE_MYSQL__ -D__CONSOLE__ -D__WAR_SYSTEM__ E em Linker adicione as seguintes libs: -lboost_filesystem -lboost_thread -lboost_system -lboost_regex -lsqlite3 -lwsock32 -llua5.1 -lws2_32 -leay32 -lmysql -lxml2 -lgmp -lz -s No mesmo Menu na aba Build Option escreva na segunda coluna horizontal escreva Obj e dê OK. Na lateral terá o nome do seu projeto o meu no caso é The Forgotten Server, clique com o botão direito do mouse em cima do nome e clique na opção Add Project: Selecione na pasta da sua source todos os arquivos .cpp e .h após isso salva o projeto e já pode compilar CTRL+F9: OpenSSL 0.9.8 1º baixe http://devpaks.org/details.php?devpak=73 2° abra Dev-Cpp > Tools > Packager Manager > Install > Seleciona o arquivo baixado e instala, fecha abre e testa! Clica aqui \/
Postado Maio 14, 2014 11 anos Este é um post popular. Muito bom cara, vai ajudar muita gente, continue assim, reputado!
Postado Maio 17, 2014 11 anos Autor Este é um post popular. Muito bom cara, vai ajudar muita gente, continue assim, reputado! Obrigado Luan, galera não custa nada, clica em gostei ou comentar agradecendo, um ato pequeno pra você e é o nosso combustível pra continuar postando bons tutoriais.
Postado Maio 17, 2014 11 anos Quando eo estava compilando deo Esse Erro //////////////////////////////////////////////////////////////////////// // OpenTibia - an opensource roleplaying game //////////////////////////////////////////////////////////////////////// // 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 3 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, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////// #include "otpch.h" #include "itemattributes.h" #include "fileloader.h" ItemAttributes::ItemAttributes(const ItemAttributes& o) { if(o.attributes) attributes = new AttributeMap(*o.attributes); } void ItemAttributes::createAttributes() { if(!attributes) attributes = new AttributeMap; } void ItemAttributes::eraseAttribute(const char* key) { if(!attributes) return; AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) attributes->erase(it); } void ItemAttributes::setAttribute(const char* key, boost::any value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, const std::string& value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, int32_t value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, float value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, bool value) { createAttributes(); (*attributes)[key].set(value); } boost::any ItemAttributes::getAttribute(const char* key) const { if(!attributes) return boost::any(); AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.get(); return boost::any(); } std::string ItemAttributes::getStringAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return std::string(); } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getString(ok); ok = false; return std::string(); } int32_t ItemAttributes::getIntegerAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return 0; } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getInteger(ok); ok = false; return 0; } float ItemAttributes::getFloatAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return 0.0; } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getFloat(ok); ok = false; return 0.0; } bool ItemAttributes::getBooleanAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return false; } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getBoolean(ok); ok = false; return false; } ItemAttribute& ItemAttribute::operator=(const ItemAttribute& o) { if(&o == this) return *this; m_data = o.m_data; return *this; } std::string ItemAttribute::getString(bool &ok) const { if(m_data.type() != typeid(std::string)) { ok = false; return std::string(); } ok = true; return boost::any_cast<std::string>(m_data); } int32_t ItemAttribute::getInteger(bool &ok) const { if(m_data.type() != typeid(int32_t)) { ok = false; return 0; } ok = true; return boost::any_cast<int32_t>(m_data); } float ItemAttribute::getFloat(bool &ok) const { if(m_data.type() != typeid(float)) { ok = false; return 0.0; } ok = true; return boost::any_cast<float>(m_data); } bool ItemAttribute::getBoolean(bool &ok) const { if(m_data.type() != typeid(bool)) { ok = false; return false; } ok = true; return boost::any_cast<bool>(m_data); } bool ItemAttributes::unserializeMap(PropStream& stream) { uint16_t n; if(!stream.getShort(n)) return true; createAttributes(); while(n--) { std::string key; if(!stream.getString(key)) return false; ItemAttribute attr; if(!attr.unserialize(stream)) return false; (*attributes)[key] = attr; } return true; } void ItemAttributes::serializeMap(PropWriteStream& stream) const { stream.addShort((uint16_t)std::min((size_t)0xFFFF, attributes->size())); AttributeMap::const_iterator it = attributes->begin(); for(int32_t i = 0; it != attributes->end() && i <= 0xFFFF; ++it, ++i) { std::string key = it->first; if(key.size() > 0xFFFF) stream.addString(key.substr(0, 0xFFFF)); else stream.addString(key); it->second.serialize(stream); } } bool ItemAttribute::unserialize(PropStream& stream) { uint8_t type = 0; stream.getByte(type); switch(type) { case STRING: { std::string v; if(!stream.getLongString(v)) return false; set(v); break; } case INTEGER: { uint32_t v; if(!stream.getLong(v)) return false; set((int32_t)v); break; } case FLOAT: { float v; if(!stream.getFloat(v)) return false; set(v); break; } case BOOLEAN: { uint8_t v; if(!stream.getByte(v)) return false; set(v != 0); } } return true; } void ItemAttribute::serialize(PropWriteStream& stream) const { bool ok; if(m_data.type() == typeid(std::string)) { stream.addByte((uint8_t)STRING); stream.addLongString(getString(ok)); } else if(m_data.type() == typeid(int32_t)) { stream.addByte((uint8_t)INTEGER); stream.addLong(getInteger(ok)); } else if(m_data.type() == typeid(float)) { stream.addByte((uint8_t)FLOAT); stream.addLong(getFloat(ok)); } else if(m_data.type() == typeid(bool)) { stream.addByte((uint8_t)BOOLEAN); stream.addByte(getBoolean(ok)); } else std::clog << "[itemAttribute::serialize]: Invalid data type." << std::endl; } Alguem me ajuda por favor . do rep ++
Postado Maio 17, 2014 10 anos Autor Quando eo estava compilando deo Esse Erro //////////////////////////////////////////////////////////////////////// // OpenTibia - an opensource roleplaying game //////////////////////////////////////////////////////////////////////// // 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 3 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, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////// #include "otpch.h" #include "itemattributes.h" #include "fileloader.h" ItemAttributes::ItemAttributes(const ItemAttributes& o) { if(o.attributes) attributes = new AttributeMap(*o.attributes); } void ItemAttributes::createAttributes() { if(!attributes) attributes = new AttributeMap; } void ItemAttributes::eraseAttribute(const char* key) { if(!attributes) return; AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) attributes->erase(it); } void ItemAttributes::setAttribute(const char* key, boost::any value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, const std::string& value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, int32_t value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, float value) { createAttributes(); (*attributes)[key].set(value); } void ItemAttributes::setAttribute(const char* key, bool value) { createAttributes(); (*attributes)[key].set(value); } boost::any ItemAttributes::getAttribute(const char* key) const { if(!attributes) return boost::any(); AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.get(); return boost::any(); } std::string ItemAttributes::getStringAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return std::string(); } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getString(ok); ok = false; return std::string(); } int32_t ItemAttributes::getIntegerAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return 0; } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getInteger(ok); ok = false; return 0; } float ItemAttributes::getFloatAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return 0.0; } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getFloat(ok); ok = false; return 0.0; } bool ItemAttributes::getBooleanAttribute(const std::string& key, bool &ok) const { if(!attributes) { ok = false; return false; } AttributeMap::iterator it = attributes->find(key); if(it != attributes->end()) return it->second.getBoolean(ok); ok = false; return false; } ItemAttribute& ItemAttribute::operator=(const ItemAttribute& o) { if(&o == this) return *this; m_data = o.m_data; return *this; } std::string ItemAttribute::getString(bool &ok) const { if(m_data.type() != typeid(std::string)) { ok = false; return std::string(); } ok = true; return boost::any_cast<std::string>(m_data); } int32_t ItemAttribute::getInteger(bool &ok) const { if(m_data.type() != typeid(int32_t)) { ok = false; return 0; } ok = true; return boost::any_cast<int32_t>(m_data); } float ItemAttribute::getFloat(bool &ok) const { if(m_data.type() != typeid(float)) { ok = false; return 0.0; } ok = true; return boost::any_cast<float>(m_data); } bool ItemAttribute::getBoolean(bool &ok) const { if(m_data.type() != typeid(bool)) { ok = false; return false; } ok = true; return boost::any_cast<bool>(m_data); } bool ItemAttributes::unserializeMap(PropStream& stream) { uint16_t n; if(!stream.getShort(n)) return true; createAttributes(); while(n--) { std::string key; if(!stream.getString(key)) return false; ItemAttribute attr; if(!attr.unserialize(stream)) return false; (*attributes)[key] = attr; } return true; } void ItemAttributes::serializeMap(PropWriteStream& stream) const { stream.addShort((uint16_t)std::min((size_t)0xFFFF, attributes->size())); AttributeMap::const_iterator it = attributes->begin(); for(int32_t i = 0; it != attributes->end() && i <= 0xFFFF; ++it, ++i) { std::string key = it->first; if(key.size() > 0xFFFF) stream.addString(key.substr(0, 0xFFFF)); else stream.addString(key); it->second.serialize(stream); } } bool ItemAttribute::unserialize(PropStream& stream) { uint8_t type = 0; stream.getByte(type); switch(type) { case STRING: { std::string v; if(!stream.getLongString(v)) return false; set(v); break; } case INTEGER: { uint32_t v; if(!stream.getLong(v)) return false; set((int32_t)v); break; } case FLOAT: { float v; if(!stream.getFloat(v)) return false; set(v); break; } case BOOLEAN: { uint8_t v; if(!stream.getByte(v)) return false; set(v != 0); } } return true; } void ItemAttribute::serialize(PropWriteStream& stream) const { bool ok; if(m_data.type() == typeid(std::string)) { stream.addByte((uint8_t)STRING); stream.addLongString(getString(ok)); } else if(m_data.type() == typeid(int32_t)) { stream.addByte((uint8_t)INTEGER); stream.addLong(getInteger(ok)); } else if(m_data.type() == typeid(float)) { stream.addByte((uint8_t)FLOAT); stream.addLong(getFloat(ok)); } else if(m_data.type() == typeid(bool)) { stream.addByte((uint8_t)BOOLEAN); stream.addByte(getBoolean(ok)); } else std::clog << "[itemAttribute::serialize]: Invalid data type." << std::endl; } Alguem me ajuda por favor . do rep ++ Cadê o erro?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.