Jump to content
Forgot your email address? ×
×
×
  • Create New...
  • 0

Guild storage


DarkFire

Question

  • Premium

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

4 answers to this question

Recommended Posts

  • 0
  • Premium

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.

  • Love 2
Link to comment
  • 0
  • Premium

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
  • 0
  • Premium
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
  • 0

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 error
SYSERR: Mar 24 20:25:29.618898 :: Boot: guild safebox initial size error
SYSERR: Mar 24 20:25:29.899474 :: pid_deinit:
 

Edited by Cilindro
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


  • Read our Rules
  • Activity

    1. 7

      PHOENIX2 !OLDSCHOOL SERVER, PAYTOWIN REMOVED!

    2. 0

      special_item_group and chest apprentice

    3. 2

      Alternative Alternative Zodiac Suit - Ninja M

    4. 0

      character details negative bonus

    5. 0

      Questlib mysql_query function problem

  • Recently Browsing

    • No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.