undefined reference to `SetTextColor@8'
I got the "undefined reference to `SetTextColor@8' " error while compiling a c++ program using g++ under windows. The complete error log is here http://pastebin.com/DCwHKkeE I guess i am missing some librar开发者_StackOverflow社区y file but don't know which ones. Please help
The SetTextColor
func is defined in gdi32.lib according to the MSDN docs, so you'll need to link libgdi32.a
in mingw.
Just link the libgdi32 and it should be fixed.
g++ -g main.cpp -o main.exe -lgdi32 -lmingw32
精彩评论