2014-02-10 30 views
0

我正在嘗試使用CImg庫,但我無法使其工作。我在終端工作在Mac上,我寫了一個Hello World程序CImg找不到函數draw_text

#include "CImg.h" 
using namespace cimg_library; 
int main() { 
const unsigned char purple[] = { 255,0,255 }; 
CImg<unsigned char>(640,400,1,3,0).draw_text("Hello World",100,100,purple).di\ 
splay("My first CImg code"); 
return 0; 
} 

這就要求圖書館的「draw_text」功能。我包括頁眉和編譯像

g++ -o hello_word.exe hello_world.cpp -O2 -L/usr/X11R6/lib -lm -lpthread -lX11 -I/opt/X11/include 

我得到的錯誤是:

error: no matching function for call to ‘cimg_library::CImg<unsigned char>::draw_text(const char [12], int, int, const unsigned char [3])’ 

任何想法?謝謝!

回答