Bonjour tout le monde.
Je débute en C++, et j'ai un petit problème :
J'ai fait un petit programme qui devrai dessiner un point rouge sur le bureau
mais ça ne marche pas :
[Linker error] undefined reference to 'SetPixel@16'
Voici mon code : "
#include <stdio.h>
#include <windows.h>
struct COORDS_2D_INT
{
int x;
int y;
};
struct COULEUR
{
int r;
int g;
int b;
};
struct setPixStruct
{
COORDS_2D_INT position;
COULEUR color;
};
COORDS_2D_INT TOP_LEFT_SCREEN;
COORDS_2D_INT SCREEN_SIZE;
COULEUR BACK_COLOR;
void initialize(void);
void setPix(setPixStruct);
void initialize(void)
{
TOP_LEFT_SCREEN.x = 100; TOP_LEFT_SCREEN.y = 100;
SCREEN_SIZE.x = 100; SCREEN_SIZE.y = 100;
BACK_COLOR.r = 0; BACK_COLOR.g = 0; BACK_COLOR.b = 0;
}
void setPix(setPixStruct Pixel)
{
if ((!(Pixel.position.x < SCREEN_SIZE.x)) || (!(Pixel.position.y < SCREEN_SIZE.y)))
{
return;
}
HDC hDC = GetDC(0);
SetPixel(hDC, Pixel.position.x + TOP_LEFT_SCREEN.x, Pixel.position.y + TOP_LEFT_SCREEN.y, (Pixel.color.r + (Pixel.color.g * 256) + (Pixel.color.b * 256 * 256)));
ReleaseDC(0,hDC);
return;
}
int main(void)
{
initialize();
setPixStruct myPix;
myPix.position.x = 1;
myPix.position.y = 1;
COULEUR mCoul;
mCoul.r = 255;
mCoul.g = 0;
mCoul.b = 0;
myPix.color = mCoul;
setPix(myPix);
return 0;
}
"
Apparemment, c'est la fonction setPix() qui ne marche pas, mais pourquoi ??? 
Merci d'avance pour la réponse. 