I drew a little graph in paint that explains my problem:
But it doesn't seem to show up when I use the <img>
tag after posting?
Graph:
You need to instantiate the database outside of main(), otherwise you will just declare a local variable shadowing the global one.
GameServer.cpp:
#include GameSocket.h
Database db(1, 2, 3);
int main() {
//whatever
}