Deriving from another Visual C++ Project?

Started by
1 comment, last by Paylegrave 8 years, 3 months ago

Hello!

I have a little issue which I hope you can help with, it was a little awkward to title so apologies if it is misleading although I believe it summaries the question.

I have a VS Solution with two projects, one contains the entry point and eventually gameplay code, whereas the other is the actual framework in which the game will built around. I want the project with the entry to point to reference the second project's code such as it's math or rendering functions, however I'm not quite sure how I would go about that as I have never done such a task before. I initially thought that I would build the framework project as library and then reference the library in the first project, however that may cause some issues in regards to SDL2 unless it was statically linked into the framework project in which case I just use a single .dll alongside the .exe of the main project. However, I have previously read (a while ago) that you just reference the project and derive its code in another project, I'm not quite sure?

I'd appreciate any guidance on the subject, thanks in advance!smile.png

- Tucker

Advertisement
It's reasonably simple smile.png

For your "framework" project, just make sure it's set up to be a static library (Right Click -> Properties -> General -> Configuration Type).

For your "game" project, set your framework project as a dependency (Right Click -> Build Dependencies -> Project Dependencies -> Check the box next to your framework project in the list). This part will work whether your framework is a static library or a DLL, but for simplicity's sake, you should probably stick with static libraries.

And that should be it.

Thanks, that worked like a charm; I appreciate the help. :)

This topic is closed to new replies.

Advertisement