我有兩個項目的解決方案 - proj_1
,proj_2
。無法解析的外部符號 - 從其他項目調用靜態函數
proj_1
是LIB項目,proj_2
是常規項目
在proj_2
我有功能命名爲static void proj_2_func()
。 我試圖從proj_1
(不創建對象)調用該函數,但我得到鏈接錯誤 - unresolved external symbol
。
proj_2:
class proj_2_class
{
public:
static void proj_2_func(); //the implementation is not relevant
}
proj_1:
in cpp file:
#include proj_2_class.h // I added the path to "additional include files" in proj_1
void proj_1_class::proj_1_func()
{
proj_2_class::proj_2_func();
}
生病是高興,對錯誤的指導。
謝謝。
的可能的複製[什麼是未定義參考/解析的外部符號錯誤以及如何解決它?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-doi-i-fix) – Danh