again, just add -lgdi32 to your linker cmdline
-lgdi32
and, just out of curiosity:
g++ --version
reports what ?