我有两个项目的解决方案 - 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