one or more multiply defined symbols found怎么回事啊#include "windows.h"LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){HWND hwnd;MSG Msg;WNDCLASS wnd
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 08:34:59
one or more multiply defined symbols found怎么回事啊#include "windows.h"LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){HWND hwnd;MSG Msg;WNDCLASS wnd
one or more multiply defined symbols found怎么回事啊
#include "windows.h"
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HWND hwnd;
MSG Msg;
WNDCLASS wndclass;
char lpszClassName[]="窗口";
char lpszTitle[]="my_windows";
wndclass.style=0;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=lpszClassName;
if(!RegisterClass(&wndclass))
{
MessageBeep(0);
return FALSE;
}
hwnd=CreateWindow(lpszClassName,
lpszTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL,
);
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&Msg,NULL,0,0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
LRESULT CALLBACK WndProc( HWND hwnd,
UINT message,
WPARAM wParam,
LPARAM lParam
)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
default :
return DefWindowProc(hwnd,message,wParam,lParam);
}
return (0);
}
这是我的程序,为什么编译通过 连接的时候出现one or more multiply defined symbols found 的错误啊 郁闷阿 我是新手 请直接改到我的程序上
one or more multiply defined symbols found怎么回事啊#include "windows.h"LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){HWND hwnd;MSG Msg;WNDCLASS wnd
不知道你是什么问题
按以下步骤 重建
双击vc打开
新建 工程 选win32 Application
加入文件名 默认项 完成
新建 C++ Source File源文件 输入文件名 完成
粘贴你的代码
插入下面一行
wndclass.hbrBackground=(HBRUSH)GetStockObject(GRAY_BRUSH);
看看能不能编译通过 运行出来了