Menu

Erro on do_attack.cpp

Help
NorteSul
2009-10-10
2014-02-04
  • NorteSul

    NorteSul - 2009-10-10

    /gameserv-1.3.5$ make
    g++ -Wall  -g -O2 -c aClient.cpp
    g++ -Wall  -g -O2 -c boolean.cpp
    boolean.cpp: In function 'bool passcmp(const char*, char*)':
    boolean.cpp:166: warning: array subscript is above array bounds
    g++ -Wall  -g -O2 -c config.cpp
    g++ -Wall  -g -O2 -c c_forest.cpp
    g++ -Wall  -g -O2 -c do_admin.cpp
    g++ -Wall  -g -O2 -c do_attack.cpp
    do_attack.cpp: In function 'void do_attack(char*)':
    do_attack.cpp:58: error: 'rand' was not declared in this scope
    do_attack.cpp:69: error: 'rand' was not declared in this scope
    do_attack.cpp:76: error: 'rand' was not declared in this scope
    make: ***  Error 1

     
  • Anonymous

    Anonymous - 2009-12-10

    Add
    `#include <cstdlib>`
    to the header info for do_attack.cpp and player.cpp (its because of the g++ <4.3 libraries)
    Add
    `#include <cstring>`
    to do_help.cpp and  news.cpp.  Add both to strings.cpp

     
  • Fran89

    Fran89 - 2009-12-14

    Better yet, add them to "extern.h", however now i get this error:

        tcpclient.cpp: In function ‘int daemon(int, int)’:
        tcpclient.cpp:813: error: declaration of ‘int daemon(int, int)’ throws different exceptions
        tcpclient.cpp:57: error: from previous declaration ‘int daemon(int, int) throw ()’
        tcpclient.cpp: In function ‘int daemon(int, int)’:
        tcpclient.cpp:845: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result
        tcpclient.cpp:851: warning: ignoring return value of ‘int dup(int)’, declared with attribute warn_unused_result
        tcpclient.cpp:851: warning: ignoring return value of ‘int dup(int)’, declared with attribute warn_unused_result
        make: ***  Error 1

     
  • Fran89

    Fran89 - 2009-12-14

    ok i commented out line 57 in tcpclient.cpp:

        // Make this a daemon
        //int daemon(int nochdir, int noclose);
    It then compiled with no errors..

     
  • Phil Taylor

    Phil Taylor - 2014-02-04

    This does not work with the current version of gameserv with the bugfix. I am using the current version of centos. Please advise me what I can do in order to compile the current version of gameserv please??

     
  • Phil Taylor

    Phil Taylor - 2014-02-04

    This is the error I am getting

    make
    g++ -Wall -g -O2 -c do_attack.cpp
    do_attack.cpp: In function ‘void do_attack(char)’:
    do_attack.cpp:58: error: ‘rand’ was not declared in this scope
    do_attack.cpp:69: error: ‘rand’ was not declared in this scope
    do_attack.cpp:76: error: ‘rand’ was not declared in this scope
    make:
    ** [do_attack.o] Error 1

     

Log in to post a comment.