undefined reference to `WinMain@16'

Je ne sais pas comment regler le probleme de compilation HELP avec code::Block

Voici le code;

#include <iostream>
#include <cstdlib>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "Table_Hachage.h"
#if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#elif defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif

#include <tchar.h>
#include <windows.h>

/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/* Make the class name into a global variable */
TCHAR szClassName[ ] = _T("Choix Fumeur ou Non Fumeur");

int WINAPI WinMain (HINSTANCE hthisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd, hwndButton, icon_button;
//HINSTANCE hInstance;
//HICON hIcon1;
//LRESULT RAPPEL WndProc (HWND, UINT, WPARAM, LPARAM);
WNDCLASSEX wincl;
MSG msg;
WNDCLASS wc = { sizeof (wc)};
wc.lpszClassName = TEXTE ( "Static Control" );
wc.hInstance = hInstance;
wc.hbrBackground = GetSysColorBrush (COLOR_3DFACE);
wc.lpfnWndProc = WndProc; // erreur: undefined reference to `
WndProc (HWND__ *, unsigned int, unsigned int, long) '
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);

RegisterClass (et wc);
hwnd = CreateWindow (wc.lpszClassName, TEXT ( "fenĂȘtre Win32 de base" ),
WS_OVERLAPPEDWINDOW,
100, 100, 330, 270, 0, 0, hInstance, 0);

ShowWindow (hwnd, nCmdShow);
UpdateWindow (hwnd);


tandis que (GetMessage (& msg, NULL, 0, 0))
{
TranslateMessage (& msg);
DispatchMessage (& msg);
}
retour ( int ) msg.wParam;
}

WNDPROC OldButtonProc;

LRESULT RAPPEL ButtonProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{cas WM_COMMAND:
switch (wParam)
{
cas BTN_LEFT:
/ / gérer votre bouton, cliquez ici
}

commutateur (msg) {
cas WM_LBUTTONDOWN:
playsoundfile ();
return 0;
cas WM_LBUTTONUP:
stopsoundfile ();
return 0;
}
retourner CallWindowProc (OldButtonProc, hwnd, msg, wp, lp);
}


LRESULT RAPPEL WndProc (HWND hwnd, UINT msg, WPARAM wParam, lParam LPARAM)
{

commutateur (msg)
{
cas WM_CREATE:
{
HWND hwndButton = CreateWindow (TEXTE ( "bouton" ), TEXT ( "Button" ),
WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
80, 10, 100, 50,
hwnd, (HMENU) buttonID, NULL, NULL);
OldButtonProc = (WNDPROC) SetWindowLong (hwndButton, GWL_WNDPROC, (LONG) ButtonProc);


hIcon1 = LoadIcon (NULL, IDI_WARNING);
SendMessage (icon_button, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon1);

briser ;
}

cas WM_DESTROY:
{
PostQuitMessage (0);
retourner 0;
}

}

retourner DefWindowProc (hwnd, msg, wParam, lParam);
}


Topic archived. No new replies allowed.