在学习@HisinWang的文章:MFC:TabCtrl使用教程
时在第三步
出现报错:
--------------------Configuration: TabCtrl_Demo - Win32 Debug--------------------
Compiling...
TabCtrl_Demo.cpp
: error C2146: syntax error : missing ';' before identifier 'm_Dlg1'
: error C2501: 'CDialog1' : missing storage-class or type specifiers
: error C2501: 'm_Dlg1' : missing storage-class or type specifiers
: error C2146: syntax error : missing ';' before identifier 'm_Dlg2'
: error C2501: 'CDialog2' : missing storage-class or type specifiers
: error C2501: 'm_Dlg2' : missing storage-class or type specifiers
: error C2146: syntax error : missing ';' before identifier 'm_Dlg3'
: error C2501: 'CDialog3' : missing storage-class or type specifiers
: error C2501: 'm_Dlg3' : missing storage-class or type specifiers
执行 cl.exe 时出错.
TabCtrl_Demo.exe - 1 error(s), 0 warning(s)
错误原因是把头文件加在了.cpp文件下。
最后把加载.h文件下就ok了