Premium DarkFire 12 Posted April 29, 2015 Premium Share Posted April 29, 2015 Hi dev.I want impliment the guild storage,but when i compile i have this error: In file included from stdafx.h:12, from guild_safebox.h:4, from guild.h:7, from battle.cpp:15: ../../common/utils.h: In function 'bool str_to_number(bool&, const char*)': ../../common/utils.h:2: error: redefinition of 'bool str_to_number(bool&, const char*)' ../../common/utils.h:2: error: 'bool str_to_number(bool&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(char&, const char*)': ../../common/utils.h:10: error: redefinition of 'bool str_to_number(char&, const char*)' ../../common/utils.h:10: error: 'bool str_to_number(char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned char&, const char*)': ../../common/utils.h:18: error: redefinition of 'bool str_to_number(unsigned char&, const char*)' ../../common/utils.h:18: error: 'bool str_to_number(unsigned char&, const char*)' previously defined here compile char.cpp ../../common/utils.h: In function 'bool str_to_number(short int&, const char*)': ../../common/utils.h:26: error: redefinition of 'bool str_to_number(short int&, const char*)' ../../common/utils.h:26: error: 'bool str_to_number(short int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short unsigned int&, const char*)': ../../common/utils.h:34: error: redefinition of 'bool str_to_number(short unsigned int&, const char*)' ../../common/utils.h:34: error: 'bool str_to_number(short unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(int&, const char*)': ../../common/utils.h:42: error: redefinition of 'bool str_to_number(int&, const char*)' ../../common/utils.h:42: error: 'bool str_to_number(int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned int&, const char*)': ../../common/utils.h:50: error: redefinition of 'bool str_to_number(unsigned int&, const char*)' ../../common/utils.h:50: error: 'bool str_to_number(unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long int&, const char*)': ../../common/utils.h:58: error: redefinition of 'bool str_to_number(long int&, const char*)' ../../common/utils.h:58: error: 'bool str_to_number(long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long unsigned int&, const char*)': ../../common/utils.h:66: error: redefinition of 'bool str_to_number(long unsigned int&, const char*)' ../../common/utils.h:66: error: 'bool str_to_number(long unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long long int&, const char*)': ../../common/utils.h:74: error: redefinition of 'bool str_to_number(long long int&, const char*)' ../../common/utils.h:74: error: 'bool str_to_number(long long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(float&, const char*)': ../../common/utils.h:82: error: redefinition of 'bool str_to_number(float&, const char*)' ../../common/utils.h:82: error: 'bool str_to_number(float&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(double&, const char*)': ../../common/utils.h:90: error: redefinition of 'bool str_to_number(double&, const char*)' ../../common/utils.h:90: error: 'bool str_to_number(double&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long double&, const char*)': ../../common/utils.h:99: error: redefinition of 'bool str_to_number(long double&, const char*)' ../../common/utils.h:99: error: 'bool str_to_number(long double&, const char*)' previously defined here compile char_affect.cpp gmake: *** [OBJDIR/battle.o] Error 1 gmake: *** Waiting for unfinished jobs.... In file included from stdafx.h:12, from guild_safebox.h:4, from guild.h:7, from building.cpp:10: ../../common/utils.h: In function 'bool str_to_number(bool&, const char*)': ../../common/utils.h:2: error: redefinition of 'bool str_to_number(bool&, const char*)' ../../common/utils.h:2: error: 'bool str_to_number(bool&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(char&, const char*)': ../../common/utils.h:10: error: redefinition of 'bool str_to_number(char&, const char*)' ../../common/utils.h:10: error: 'bool str_to_number(char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned char&, const char*)': ../../common/utils.h:18: error: redefinition of 'bool str_to_number(unsigned char&, const char*)' ../../common/utils.h:18: error: 'bool str_to_number(unsigned char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short int&, const char*)': ../../common/utils.h:26: error: redefinition of 'bool str_to_number(short int&, const char*)' ../../common/utils.h:26: error: 'bool str_to_number(short int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short unsigned int&, const char*)': ../../common/utils.h:34: error: redefinition of 'bool str_to_number(short unsigned int&, const char*)' ../../common/utils.h:34: error: 'bool str_to_number(short unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(int&, const char*)': ../../common/utils.h:42: error: redefinition of 'bool str_to_number(int&, const char*)' ../../common/utils.h:42: error: 'bool str_to_number(int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned int&, const char*)': ../../common/utils.h:50: error: redefinition of 'bool str_to_number(unsigned int&, const char*)' ../../common/utils.h:50: error: 'bool str_to_number(unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long int&, const char*)': ../../common/utils.h:58: error: redefinition of 'bool str_to_number(long int&, const char*)' ../../common/utils.h:58: error: 'bool str_to_number(long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long unsigned int&, const char*)': ../../common/utils.h:66: error: redefinition of 'bool str_to_number(long unsigned int&, const char*)' ../../common/utils.h:66: error: 'bool str_to_number(long unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long long int&, const char*)': ../../common/utils.h:74: error: redefinition of 'bool str_to_number(long long int&, const char*)' ../../common/utils.h:74: error: 'bool str_to_number(long long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(float&, const char*)': ../../common/utils.h:82: error: redefinition of 'bool str_to_number(float&, const char*)' ../../common/utils.h:82: error: 'bool str_to_number(float&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(double&, const char*)': ../../common/utils.h:90: error: redefinition of 'bool str_to_number(double&, const char*)' ../../common/utils.h:90: error: 'bool str_to_number(double&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long double&, const char*)': ../../common/utils.h:99: error: redefinition of 'bool str_to_number(long double&, const char*)' ../../common/utils.h:99: error: 'bool str_to_number(long double&, const char*)' previously defined here gmake: *** [OBJDIR/building.o] Error 1 In file included from stdafx.h:12, from guild_safebox.h:4, from guild.h:7, from char.cpp:34: ../../common/utils.h: In function 'bool str_to_number(bool&, const char*)': ../../common/utils.h:2: error: redefinition of 'bool str_to_number(bool&, const char*)' ../../common/utils.h:2: error: 'bool str_to_number(bool&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(char&, const char*)': ../../common/utils.h:10: error: redefinition of 'bool str_to_number(char&, const char*)' ../../common/utils.h:10: error: 'bool str_to_number(char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned char&, const char*)': ../../common/utils.h:18: error: redefinition of 'bool str_to_number(unsigned char&, const char*)' ../../common/utils.h:18: error: 'bool str_to_number(unsigned char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short int&, const char*)': ../../common/utils.h:26: error: redefinition of 'bool str_to_number(short int&, const char*)' ../../common/utils.h:26: error: 'bool str_to_number(short int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short unsigned int&, const char*)': ../../common/utils.h:34: error: redefinition of 'bool str_to_number(short unsigned int&, const char*)' ../../common/utils.h:34: error: 'bool str_to_number(short unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(int&, const char*)': ../../common/utils.h:42: error: redefinition of 'bool str_to_number(int&, const char*)' ../../common/utils.h:42: error: 'bool str_to_number(int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned int&, const char*)': ../../common/utils.h:50: error: redefinition of 'bool str_to_number(unsigned int&, const char*)' ../../common/utils.h:50: error: 'bool str_to_number(unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long int&, const char*)': ../../common/utils.h:58: error: redefinition of 'bool str_to_number(long int&, const char*)' ../../common/utils.h:58: error: 'bool str_to_number(long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long unsigned int&, const char*)': ../../common/utils.h:66: error: redefinition of 'bool str_to_number(long unsigned int&, const char*)' ../../common/utils.h:66: error: 'bool str_to_number(long unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long long int&, const char*)': ../../common/utils.h:74: error: redefinition of 'bool str_to_number(long long int&, const char*)' ../../common/utils.h:74: error: 'bool str_to_number(long long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(float&, const char*)': ../../common/utils.h:82: error: redefinition of 'bool str_to_number(float&, const char*)' ../../common/utils.h:82: error: 'bool str_to_number(float&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(double&, const char*)': ../../common/utils.h:90: error: redefinition of 'bool str_to_number(double&, const char*)' ../../common/utils.h:90: error: 'bool str_to_number(double&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long double&, const char*)': ../../common/utils.h:99: error: redefinition of 'bool str_to_number(long double&, const char*)' ../../common/utils.h:99: error: 'bool str_to_number(long double&, const char*)' previously defined here In file included from stdafx.h:12, from guild_safebox.h:4, from guild.h:7, from char_affect.cpp:12: ../../common/utils.h: In function 'bool str_to_number(bool&, const char*)': ../../common/utils.h:2: error: redefinition of 'bool str_to_number(bool&, const char*)' ../../common/utils.h:2: error: 'bool str_to_number(bool&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(char&, const char*)': ../../common/utils.h:10: error: redefinition of 'bool str_to_number(char&, const char*)' ../../common/utils.h:10: error: 'bool str_to_number(char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned char&, const char*)': ../../common/utils.h:18: error: redefinition of 'bool str_to_number(unsigned char&, const char*)' ../../common/utils.h:18: error: 'bool str_to_number(unsigned char&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short int&, const char*)': ../../common/utils.h:26: error: redefinition of 'bool str_to_number(short int&, const char*)' ../../common/utils.h:26: error: 'bool str_to_number(short int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(short unsigned int&, const char*)': ../../common/utils.h:34: error: redefinition of 'bool str_to_number(short unsigned int&, const char*)' ../../common/utils.h:34: error: 'bool str_to_number(short unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(int&, const char*)': ../../common/utils.h:42: error: redefinition of 'bool str_to_number(int&, const char*)' ../../common/utils.h:42: error: 'bool str_to_number(int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(unsigned int&, const char*)': ../../common/utils.h:50: error: redefinition of 'bool str_to_number(unsigned int&, const char*)' ../../common/utils.h:50: error: 'bool str_to_number(unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long int&, const char*)': ../../common/utils.h:58: error: redefinition of 'bool str_to_number(long int&, const char*)' ../../common/utils.h:58: error: 'bool str_to_number(long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long unsigned int&, const char*)': ../../common/utils.h:66: error: redefinition of 'bool str_to_number(long unsigned int&, const char*)' ../../common/utils.h:66: error: 'bool str_to_number(long unsigned int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long long int&, const char*)': ../../common/utils.h:74: error: redefinition of 'bool str_to_number(long long int&, const char*)' ../../common/utils.h:74: error: 'bool str_to_number(long long int&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(float&, const char*)': ../../common/utils.h:82: error: redefinition of 'bool str_to_number(float&, const char*)' ../../common/utils.h:82: error: 'bool str_to_number(float&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(double&, const char*)': ../../common/utils.h:90: error: redefinition of 'bool str_to_number(double&, const char*)' ../../common/utils.h:90: error: 'bool str_to_number(double&, const char*)' previously defined here ../../common/utils.h: In function 'bool str_to_number(long double&, const char*)': ../../common/utils.h:99: error: redefinition of 'bool str_to_number(long double&, const char*)' ../../common/utils.h:99: error: 'bool str_to_number(long double&, const char*)' previously defined here gmake: *** [OBJDIR/char_affect.o] Error 1 gmake: *** [OBJDIR/char.o] Error 1 In common/utils.h i didn't change nothing..... Link to comment Share on other sites More sharing options...
Premium Solution Cataclismo 86 Posted April 30, 2015 Premium Solution Share Posted April 30, 2015 First of all, ask your questions here next time.. About your problem, it seems you included utils.h more than just one time and your functions are redefined. Open utils.h and in top of the file, before everything else, add this: #pragma once If this does not work you should check your code for duplicate include. 2 Link to comment Share on other sites More sharing options...
Premium DarkFire 12 Posted April 30, 2015 Author Premium Share Posted April 30, 2015 Next time i will do topics in right place. Thx , but now i have this errors: input_db.cpp: In member function 'void CInputDB::GuildSafebox(BYTE, DWORD, const char*)': input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 8 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 9 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 10 has type 'long int' input_db.cpp:2839: warning: too few arguments for format input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 8 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 9 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 10 has type 'long int' input_db.cpp:2839: warning: too few arguments for format input_main.cpp: In member function 'virtual int CInputMain::Analyze(DESC*, BYTE, const char*)': input_main.cpp:3374: error: duplicate case value input_main.cpp:3301: error: previously used here input_main.cpp:3375: error: duplicate case value input_main.cpp:3289: error: previously used here input_main.cpp:3376: error: duplicate case value input_main.cpp:3293: error: previously used here input_main.cpp:3377: error: duplicate case value input_main.cpp:3305: error: previously used here input_main.cpp:3378: error: duplicate case value input_main.cpp:3313: error: previously used here input_main.cpp:3379: error: duplicate case value input_main.cpp:3309: error: previously used here compile lzo_manager.cpp compile marriage.cpp gmake: *** [OBJDIR/input_main.o] Error 1 gmake: *** Waiting for unfinished jobs.... This is the code: #ifdef __GUILD_SAFEBOX__ case HEADER_CG_GUILD_SAFEBOX_OPEN: case HEADER_CG_GUILD_SAFEBOX_CHECKIN: case HEADER_CG_GUILD_SAFEBOX_CHECKOUT: case HEADER_CG_GUILD_SAFEBOX_ITEM_MOVE: case HEADER_CG_GUILD_SAFEBOX_GIVE_GOLD: case HEADER_CG_GUILD_SAFEBOX_GET_GOLD: GuildSafebox(ch, bHeader, c_pData); break; #endif Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted May 1, 2015 Premium Share Posted May 1, 2015 input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 8 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 9 has type 'long int' input_db.cpp:2839: warning: format '%u' expects type 'unsigned int', but argument 10 has type 'long int' input_db.cpp:2839: warning: too few arguments for format Change from %u to %lu for arguments 8, 9 and 10 (count them). Also, I think you provided less arguments than it needs. input_main.cpp:3374: error: duplicate case value input_main.cpp:3301: error: previously used here You have used case SOMETHING: more than just one time (available for all errors you get!). You used on line 3301 and also on line 3374. Use them just once. If you used them just once then the values are the same even the name are not. You should provide unique numbers for each (in packet.h). If you change their values make sure you do that in client too. Link to comment Share on other sites More sharing options...
Cilindro 14 Posted March 24, 2020 Share Posted March 24, 2020 (edited) i have the same error i try all things and nothing same one can help me pleass ? In file included from stdafx.h:12:0, from guild.h:3, from battle.cpp:16: ../../common/utils.h: In function 'bool str_to_number(bool&, const char*)': ../../common/utils.h:2:13: error: redefinition of 'bool str_to_number(bool&, const char*)' inline bool str_to_number (bool& out, const char *in) ^ i use GCC49 Problem fix new problem: on syserr GAME errorSYSERR: Mar 24 20:25:29.618898 :: Boot: guild safebox initial size errorSYSERR: Mar 24 20:25:29.899474 :: pid_deinit: Edited March 24, 2020 by Cilindro Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now