cannot start a parameter declaration

This is a discussion on cannot start a parameter declaration within the C++ Programming forums, part of the General Programming Boards category; Could someone define what the compiler means when it gives the error "... cannot start a parameter declaration". I don't ...

  1. #1
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110

    cannot start a parameter declaration

    Could someone define what the compiler means when it gives the error "... cannot start a parameter declaration". I don't understand why the compiler would care what the first parameter is.

    Secondly the compiler is giving me a bunch of other errors that shouldn't be there. Like telling me I'm missing a ) when I do have the correct amount. Source file is attached, sorry if it's unclean I was actually trying to clean it up before the errors started happeing.

    Errors:

    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    server.cpp:
    Warning W8071 C:\Borland\SDL\include\SDL_endian.h 87: Conversion may lose significant digits in function SDL_Swap16(unsigned short)
    Warning W8012 tcputil.h 30: Comparing signed and unsigned values in function getmsgstr(_TCPsocket *,unsigned int)
    Warning W8004 tcputil.h 25: 'str' is assigned a value that is never used in function getmsgstr(_TCPsocket *,unsigned int)
    Warning W8071 C:\include\strexpac.h 8: Conversion may lose significant digits in function str_reverse(char *)
    Warning W8012 C:\include\strexpac.h 55: Comparing signed and unsigned values in function str_split(char *,char,char *,char *)
    Warning W8057 server.h 10: Parameter 'match_length' is never used in function strmatchup(const char *,const char *,bool)
    Error E2293 server.h 27: ) expected
    Error E2293 server.h 28: ) expected
    Error E2293 server.h 29: ) expected
    Error E2147 server.h 42: 'TPCsocket' cannot start a parameter declaration
    Error E2147 server.h 44: 'TPCsocket' cannot start a parameter declaration
    Error E2316 server.h 44: 'userman::adduser(int)' is not a member of 'userman'
    Error E2147 server.h 54: 'TPCsocket' cannot start a parameter declaration
    Error E2316 server.h 54: 'userman::renameuser(int,const char *)' is not a member of 'userman'
    Error E2147 server.h 72: 'TPCsocket' cannot start a parameter declaration
    Error E2316 server.h 72: 'userman::removeuser(int)' is not a member of 'userman'
    Error E2451 server.h 89: Undefined symbol 'num_clients' in function userman::create_sockset()
    Warning W8013 server.h 90: Possible use of 'set' before definition in function userman::create_sockset()
    Error E2034 server.h 119: Cannot convert 'char *' to '_TCPsocket *' in function userman::announce(const char *,...)
    Error E2342 server.h 119: Type mismatch in parameter 'sock' (wanted '_TCPsocket *', got 'char *') in function userman::announce(const char *,...)
    Error E2034 server.h 119: Cannot convert '_TCPsocket *' to 'char *' in function userman::announce(const char *,...)
    Error E2342 server.h 119: Type mismatch in parameter 'buf' (wanted 'char *', got '_TCPsocket *') in function userman::announce(const char *,...)
    Error E2285 server.h 120: Could not find a match for 'remove<ForwardIterator,T>(_TCPsocket *)' in function userman::announce(const char *,...)
    Warning W8004 server.h 123: 'r' is assigned a value that is never used in function userman::announce(const char *,...)
    Error E2147 server.h 125: 'TPCsocket' cannot start a parameter declaration
    Error E2034 server.h 140: Cannot convert 'int' to '_TCPsocket *' in function message(int,const char *,...)
    Error E2342 server.h 140: Type mismatch in parameter 'sock' (wanted '_TCPsocket *', got 'int') in function message(int,const char *,...)
    Warning W8057 server.h 147: Parameter 'sock' is never used in function message(int,const char *,...)
    Error E2316 server.cpp 100: 'adduser' is not a member of 'userman' in function SDL_main(int,char * *)
    Warning W8012 server.cpp 110: Comparing signed and unsigned values in function SDL_main(int,char * *)
    Error E2316 server.cpp 134: 'removeuser' is not a member of 'userman' in function SDL_main(int,char * *)
    Warning W8080 server.cpp 150: 'ipaddr' is declared but never used in function SDL_main(int,char * *)
    Warning W8080 server.cpp 150: 'host' is declared but never used in function SDL_main(int,char * *)
    Warning W8057 server.cpp 150: Parameter 'argc' is never used in function SDL_main(int,char * *)
    Warning W8057 server.cpp 150: Parameter 'argv' is never used in function SDL_main(int,char * *)
    *** 21 errors in Compile ***
    Attached Files Attached Files

  2. #2
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    I dont remember any compiler I've used complaining I havented used a parameter I set..

    Warning W8057 server.h 10: Parameter 'match_length' is never used in function strmatchup(const char *,const char *,bool)

    Borland must suck, well.. try removing that parameter since it is the first one it complains about, and bool is automatically set to false I believe so you can leave that part out in the future (especially since I didnt know assignment in parameters was allowed).
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  3. #3
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    Nay, that did not work. I do know that TCPsocket is a pointer to a structure. One of the error messages gives that away. It's the ")" error messages that are most liekyl the culprit of the rest of the errors, while the cannot start parameter declaration errors most likely are caused by the same reason the ) ones are.

    FYI: TCPsocket is defined and google "cannot start a parameter declaration" was of little help.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    why is there executable functions in a *.h file??? those should all be in *.cpp files. As for the extra errors, ignore all but the first one or two -- the rest occur because the compiler has all confused.

  5. #5
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    How exactly do I do that?

  6. #6
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    move functions strmatchup() and isvalidname() into *.cpp file (maybe server.cpp). That is only the beginning of your problems. That *.h file is filled with other errors, such as undefined identifiers, using a single instance of object us as if it were an array (method getuser() does that). Fix the errors one at a time, starting at the top of the error list. Fix and error then recompile to see other valid errors. correcting one error may eliminate 10-15 other errors.

  7. #7
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    move functions to new file) Did that, lost 2 errors.

    users is a typedef of vector<user> and user is defined. All the necessary definitons do exist.

    Oddly enough, converting all the TCPsockets to void pointers fixed the problem. It doesn't look nice, and anyone else that reads this code might not know whats going on. I'd prefer to know why the errors are being generated still though.

    [edit]
    Alright, TPCsocket was undefined, I wanted TCPsocket.
    Last edited by Dark Nemesis; 09-24-2005 at 12:40 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  2. declaration of "blah" shadows a parameter??
    By ilikepure in forum C++ Programming
    Replies: 3
    Last Post: 05-21-2007, 11:21 AM
  3. syntax linked list problem & struct problem
    By beely in forum C Programming
    Replies: 5
    Last Post: 11-11-2002, 09:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21