Simple Questions (I hope)

Started by
2 comments, last by Benny_Buckshot 21 years, 1 month ago
I''ve been working in the book "Tricks of the Windows Game Programming Gurus" and have run into a couple problems. Here at school we are on Win98 and everything was going fine. Then I tried to make a new project and everytime I tried to compile anything besides my original project I get a link error: "LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/bounce.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe." Even when I took my original project''s cpp files and everything associated with them (the resource files) and put them in a new folder and tried to compile it I ended up with the same error. So to fix this I emailed a couple of files home to try them out (WinXP at home) and I got an error with my brush. The line "winclass.hbrBackground = GetStockObject(WHITE_BRUSH);" gave me an error about an invalid conversion (I don''t have the exact error here at school). I also got the error on "old_pen = SelectObject(hdc, new_pen);" The error had something to do with a void to HBRUSH, something like that. Is there anyone that might be able to help me out with this?
Advertisement
You may have created a console application instead of a Win32 application. In that case the compiler is looking for the main() entrypoint instead of WinMain().

You need to cast the brush handle.
Try winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
"unresolved external symbol _main"
watch out if you''re using a console application instead of a windows.
TG Ramsus
Thanks!! Now that I feel stupid... I''ll go fix that.

This topic is closed to new replies.

Advertisement