# VS2008: Multi-Project Solution Setup

This topic is 3871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Im using C++ in Visual Studio 2008, and I'm familiar with writing my games in one project within a solution. Now I want to tackle a client-server multiplayer game. I have created my solution, MyGameSolution, with a project, MyGameServer. Then, I add a second project to the solution, MyGameClient. Of course, the server and client will have many classes in common. Where is the efficient (or necessary) place to put the class files for the common classes? Server project? Client project? A new common folder? I realize I should be able to decide whats best for my situation, but I cannot seem to find a configuration that allows me to have two projects referencing the same classes so don't have to have a separate copy of the files in each project folder. Thanks in advance for any instructions or advice.

##### Share on other sites
You have two solutions: Server and Client.

Server.sln+-- network (project) - shared+-- network_server (project)+-- game (project)Client.sln+-- network (project) - shared+-- network_client (project)+-- game (project)

Above, network project is shared between both. Other two projects are client/server specific.

##### Share on other sites
Quote:
 Original post by JeffNikoI cannot seem to find a configuration that allows me to have two projects referencing the same classes so don't have to have a separate copy of the files in each project folder.

Create a library project for common classes that compiles to DLL. Then you can reference it by both client and server projects

1. 1
2. 2
3. 3
frob
20
4. 4
Rutin
19
5. 5

• 32
• 13
• 11
• 9
• 18
• ### Forum Statistics

• Total Topics
632555
• Total Posts
3007066

×