0

Hello, where is the problem in this code? it seems ok but i get "unresolved external symbol " error" for Server::SetMode() :/ damn

// Server.h

class Server
{
    public:
        Server();
        static const int MODE_NONE = 1;
        static int SERVER_MODE;
        void SetMode();
};




// Server.cpp
#include "Server.h"

Server::Server()
{

}

void Server::SetMode()
{
  SERVER_MODE = MODE_NONE;
}
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by phorce
0

Hey

I don't know if this would work, but try it..

class Server {

    public: 
        Server();
        void SetMode();
    protected:
      static const int MODE_NONE;
      static int SERVER_MODE;

};

Also, in your class functions:

// set the mode in your main
void Server::SetMode(int theModeNone)
{
  SERVER_MODE = theModeNone;
}

// then in main
// have something like this:

Server s;

s.setMode(1);

Hope this helps, in your classes, try splitting the functions/variables seperately (Like the example) and using private/protected

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.