-
Linker Error
I am attempting to compile the example of a windows app from the tutorial on this site, but I keep getting a [linker error] undefined reference on functions SetTextColor, TextOut, and GetStockObject.
I think maybe this is because I don't #include <stdafx.h> but when I do it says I don't have four other header files (afxwin, afxext, afxcmn, and d3drmwin).
I am using Dev-C++ and it didn't come with the stdafx header, I got that one from a source code I downloaded.
So my question is, what compiler does come with all of these, or where can I find them? (I don't want to spend so much money on visual C++ just yet).
I am very new to this, and any help is appreciated.
-
-
Code:
case WM_PAINT:
hdc = BeginPaint(hwnd, &paintstruct);
SetTextColor(hdc, COLORREF(0x00FF0000));
TextOut(hdc,150,150,string,sizeof(string)-1);
EndPaint(hwnd, &paintstruct);
return 0;
Code:
wincl.cbSize = sizeof(WNDCLASSEX);
wincl.style = CS_HREDRAW | CS_VREDRAW;
wincl.lpfnWndProc = WndProc;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hInstance = hInstance;
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
This is an exact copy of the example on this site, which is why I didn't post it at first. When I include stdafx.h the linker error goes away, but as I said, there are other 4 other header files I don't have, so I gotta be doing something wrong...
EDIT: I did some searching and found that I needed to include the OpenGL libraries, but when I did that I still get a linker error, but this time on something called "__gxx_personality_v0"
That line is never used in my program, so now i'm really lost...