开发者

undefined reference to `SetTextColor@8'

开发者 https://www.devze.com 2023-03-05 16:15 出处:网络
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 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

精彩评论

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