请教一个问题 程序出错了!-->woodhead转移
我用vc6.0:首选建了一个win32 application的空工程
然后写了一个text1.cpp的文件:
#include <afxwin.h>
// Declare the application class
class CHelloApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
// Create an instance of the application class
CHelloApp HelloApp;
// Declare the main window class
class CHelloWindow : public CFrameWnd
{
CStatic * cs;
public:
CHelloWindow();
};
// The InitInstance function is called each
// time the application first executes.
BOOL CHelloApp::InitInstance()
{
m_pMainWnd = new CHelloWindow();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
// The constructor for the window class
CHelloWindow::CHelloWindow()
{
// Create the window itself
Create(NULL,
"Hello World!",
WS_OVERLAPPEDWINDOW,
CRect(0,0,200,200));
// Create a static label
cs = new CStatic();
cs->Create("hello world",
WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(50,80,150,150),
this);
}
然后在工程中seting中使用mfc共享dll然后运行出错:
--------------------Configuration: lili - Win32 Debug--------------------
Compiling...
Text1.cpp
d:\lishiwen\lili\text1.cpp(2) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(2) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(2) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(2) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(2) : error C2014: preprocessor command must start as first nonwhite space
d:\lishiwen\lili\text1.cpp(3) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(3) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(3) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(3) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(4) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(4) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(4) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(4) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(5) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(5) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(5) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(5) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(5) : error C2504: 'CWinApp' : base class undefined
d:\lishiwen\lili\text1.cpp(6) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(6) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(6) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(6) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(7) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(7) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(7) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(7) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(7) : error C2146: syntax error : missing ';' before identifier 'InitInstance'
d:\lishiwen\lili\text1.cpp(7) : error C2433: 'BOOL' : 'virtual' not permitted on data declarations
d:\lishiwen\lili\text1.cpp(7) : error C2501: 'BOOL' : missing storage-class or type specifiers
d:\lishiwen\lili\text1.cpp(8) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(8) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(8) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(8) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(9) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(9) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(9) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(9) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(10) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(10) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(10) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(10) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(11) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(11) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(11) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(11) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(12) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(12) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(12) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(12) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(13) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(13) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(13) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(13) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(13) : error C2504: 'CFrameWnd' : base class undefined
d:\lishiwen\lili\text1.cpp(14) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(14) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(14) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(14) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(14) : error C2143: syntax error : missing ';' before '*'
d:\lishiwen\lili\text1.cpp(14) : error C2501: 'CStatic' : missing storage-class or type specifiers
d:\lishiwen\lili\text1.cpp(14) : error C2501: 'cs' : missing storage-class or type specifiers
d:\lishiwen\lili\text1.cpp(15) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(15) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(15) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(15) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(16) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(16) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(16) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(16) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(17) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(17) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(17) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(17) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(18) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(18) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(18) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(18) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(19) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(19) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(19) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(19) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(20) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(20) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(20) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(20) : error C2018: unknown character '0xa1'
d:\lishiwen\lili\text1.cpp(20) : error C2143: syntax error : missing ';' before 'tag::id'
d:\lishiwen\lili\text1.cpp(20) : error C2501: 'BOOL' : missing storage-class or type specifiers
d:\lishiwen\lili\text1.cpp(20) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
lili.exe - 1 error(s), 0 warning(s)