Ellipse() and Rectangle() functions linker error undefiend reference to Rectangle@20
Hi guys Im having a problem with Painting a rectangle on a window.
the following gives me 2 linker errors from the Rectangle and Ellipse functions.
1 2 3 4 5 6 7 8 9
|
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
Rectangle(hdc, 0, 0, 200, 100);
//Line(hdc, 0, 0, 200, 100);
Ellipse(hdc, 0, 0, 200, 100);
EndPaint(hwnd, &ps);
return 0;
|
[linker error] undefined reference to 'Rectangle@20'
[Linker error] undefined reference to 'Ellipse@20'
in Dev-c++
Please help
Are you linking with the correct libraries - in particular Gdi32.lib ?
i dont know the files at the top are
1 2 3 4 5 6 7 8 9
|
//#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
#include <cstdlib>
#include <math.h>
//#include <cmath.h>
//#include <math>
#include <cmath>
using namespace std;
|
whats Gdi32.lib and how do i link it?
Thank you for responding
What IDE are you using??
He is using dev-c++, according to first post.
Add gdi32.a as linker input.
I need specs :-)
Topic archived. No new replies allowed.