Seltsamer Fehler
-
Hi!
Ich bekomme immer folgenden Fehler, wenn ich ein Fenster erstellen möchte:
Bibliothek Debug/Engine.lib und Objekt Debug/Engine.exp wird erstellt
Main.obj : error LNK2001: Nichtaufgeloestes externes Symbol "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
LIBCD.lib(crt0.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _main
Debug/Engine.exe : fatal error LNK1120: 2 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.#include "rbw3d.h" #include "InitD3D.h" #include <windows.h> LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { InitD3D spitz; WNDCLASS wndclass; MSG msg; HWND hwnd; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hInstance = hInstance; wndclass.lpfnWndProc = WndProc; wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wndclass.lpszMenuName = NULL; wndclass.lpszClassName = "3D Game"; RegisterClass(&wndclass); CreateWindow("3D Game", "3D", WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); ShowWindow(hwnd, SW_SHOW); return 0; } LRESULT CALLBACK WndPRoc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_CREATE: return 0; }; return DefWindowProc(hwnd, message, wParam, lParam); };
-
[cpp]
//liegt eventuell an dem typo
LRESULT CALLBACK WndPRoc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_CREATE:
return 0;
};
return DefWindowProc(hwnd, message, wParam, lParam);
};
[/cpp]
-
Wenn ich das dann beribe kommt immer noch der Main Fehler!
LIBCD.lib(crt0.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _main
Debug/Engine.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.
-
klingt, als hättest du keine win32 sondern eine konsolen anwedung gemacht^^