0
它的.cpp超出這個應該是簡單的,但我失去的睡眠了它:(VS2010如何.H連接到項目的目錄
我有幾個班分成的.h和.cpp,我在項目之外放置到一個單獨的'classes'文件夾中,以便多個項目可以訪問它們。
在項目屬性 - > VC++目錄下 我改變了'include directories'參數,
從我的類的.h似乎可以在項目中使用,但我的.cpp沒有被鏈接正確,因爲它們導致「編譯時出現錯誤LNK2019:無法解析的外部符號」問題。我找不到類似的論壇主題的解決方案有關鏈接的問題...
//this is how the .cpp starts
//is the path wrong ? Am I missing a VS2010 setting somewhere ?
//I've tried several alternatives including full path name, brackets..
#include "CMyClass.h"
我的目錄看起來像「Visual Studio 2010的.. \ \項目\」
project_one //wants to use a class from the 'classes' folder
project_two //also wants to use a class from the 'classes' folder
classes //.h and .cpp are in here
的類都被這下在自己的遊戲機中進行測試,所以定義肯定存在。這些類位於與項目分離的新目錄中。
如何讓他們找到他們的.cpp?
謝謝!這完美地回答了它 – Soran 2014-10-17 02:46:52