2016-06-13 126 views
1

我正在使用Visual Studio 2015社區版。我正在嘗試構建一個非常基本的遊戲引擎。我想讓引擎的核心部分與物理和渲染代碼分開。我知道如何將第二物理和渲染器項目添加到主要的核心解決方案。但是,如何建立關係,以及如何訪問解決方案核心部分中的渲染器和物理文件?是否需要對項目屬性進行必要的更改,如鏈接器和VC++目錄?編譯和使用Visual Studio中的單個解決方案的多個項目

回答

0
<project name> (Core) 
    <solution1> (Core project) 
    <solution2> (Physics) 
    <solution3> (Renderer) 

在覈心項目中,您想使用Physics和Renderer。要連結它們之間的項目去Core project -> options -> common properties -> references -> add new reference -> check Physics and Renderer在此之後就可以對鏈接器和VC++目錄(C/C++ - > general -> additional include directories and Linker - > general -> additional include directoriesLinker - > general -> input -> additional dependencies

+0

我需要的物理和渲染項目的頭文件添加到VC++目錄設置?有.lib文件是我需要在物理和渲染器項目中加入Linker嗎?很抱歉,我在與Visual Studio合作方面處於落後狀態。 –

+0

「我需要添加頭文件」 - Core項目,是:' C/C++ - > general - > additional include directories'-在這裏你指定你有頭文件的位置。「有需要添加到鏈接器的.lib文件」 - 如果和< solution3>是dll,這些DLL會創建.lib和.dll。'鏈接器 - >常規 - >附加包含目錄「 - 在這裏指定你的lib所在的文件夾。如果< solution2>和不是dll,請不要在連接器上改變任何東西。對不起,如果我不清楚。隨便問。 – Skywrath

+0

看看這個[什麼是.sln和.vcproj文件,它們包含什麼?](http://stackoverflow.com/questions/7133796/what-are-sln-and-vcproj-files-and-what- do-they-contain),在我的示例中.sln是,而.vcxproj是等等。 – Skywrath

相關問題