7
静态函数已声明但未在C ++中定义
使用C ++从以下代码中获取错误。 Main.cpp #include "file.h" int main() { int k = GetInteger(); return 0; } 文件.h static int GetInteger(); File.cpp #include "file.h" static int GetInteger() { return 1; } 我得到的错误: Error C2129: static function 'int GetInteger(void)' declared but not defined. 我已经读过著名的文章“在C和C ++中组织代码文件”,但不了解此代码有什么问题。