开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜