次のエラーが表示されます。自力では解決できませんでした。
エラーメッセージ:
interface.cpp:191:10: error: request for member 'FaceSize' in 'interface::font', which is of non-class type 'void*'
font.FaceSize(fontSize);
^
interface.cpp:202:18: error: request for member 'Render' in 'interface::font', which is of non-class type 'void*'
font.Render(todisplay);
^
interface.cpp:215:10: error: request for member 'Render' in 'interface::font', which is of non-class type 'void*'
font.Render(todisplay);
^
以下は、エラーの発生元のコード スニペットです。
#if defined(__APPLE__)
FTGLPixmapFont font("/Library/Fonts/Arial.ttf");
#elif defined(_WIN32) || defined(_WIN64) || defined(WINDOWS) || defined(MINGW) || defined(MINGW64)
FTGLPixmapFont font("C:\\Windows\\Fonts\\Arial.ttf");
#elif defined(__LINUX__)
FTGLPixmapFont
font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf");
#endif
font.FaceSize(fontSize);
glPushMatrix();
for (float xCount = -borderWidth/2; xCount <= borderWidth/2; xCount++)
{
for (float yCount = -borderWidth/2; yCount <= borderWidth/2; yCount++)
{
glRasterPos3f(
x+xCount*fontscaleX,
y+yCount*fontscaleY,
INTERFACE_TEXT_SHADER_DEPTH
);
font.Render(todisplay);
}
}
glColor3f(foregroundRed, foregroundGreen, foregroundBlue);
glRasterPos3f(x, y, INTERFACE_TEXT_DEPTH);
font.Render(todisplay);
glPopMatrix();
このコードは OS X で問題なく完全にビルドされています。しかし、ubuntu でビルドしようとすると、ビルドに失敗します。アイコンスクリプトを使用してビルドしようとしています。以下は、interface.cpp ファイルをコンパイルするコマンドです。
g++ -o interface.o -c -Wall -ansi -pedantic -O2 -lGL -lGLU -lX11 -std=c++11 -DSETTINGS_DEVELOPMENT -DUSER_UMA -I/usr/include/mysql -I/opt/local/include - I/usr/include/boost/system -I/usr/include/boost -I/usr/include/boost/test -I/usr/include/boost/timer -I/opt/local/include/mariadb/mysql - I/usr/include/freetype2 -Irapidxml -Ilru_cache interface.cpp