【发布时间】:2011-12-12 22:19:01
【问题描述】:
main.cpp
int main()
{
return 0;
}
细胞.h
#pragma once
class _cell {};
细胞.cpp
#include "cell.h"
实验.h
#pragma once
class _experiment
{
_cell cell;
};
experiment.cpp
#include "experiment.h"
#include "cell.h"
错误:
experiment.h(5): error C2146: syntax error : missing ';' before identifier 'cell'
experiment.h(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
experiment.h(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
这让我发疯了。有什么帮助吗?谢谢!
【问题讨论】:
-
通常您只希望看到编译器定义的符号以下划线开头。
-
我总是使用 _type 作为类型。感谢您的提示,从现在开始将尝试使用其他东西
标签: c++ windows visual-studio