C++ 在不同的操作系统中运行时出错

C++ 在不同的操作系统中运行时出错,c++,ubuntu,fonts,g++,ftgl,C++,Ubuntu,Fonts,G++,Ftgl,我得到以下错误。我自己解决不了 错误消息: 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',

我得到以下错误。我自己解决不了

错误消息:

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();
#如果定义(uuu苹果公司)
FTGLPixmapFont字体(“/Library/Fonts/Arial.ttf”);
#elif已定义(_WIN32)|已定义(_WIN32)|已定义(WINDOWS)|已定义(MINGW)|已定义(MINGW64)
FTGLPixmapFont字体(“C:\\Windows\\Fonts\\Arial.ttf”);
#已定义的elif(_LINUX__;)
FTGLPixmapFont
字体(“/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf”);
#恩迪夫
字体大小(fontSize);
glPushMatrix();

对于(float xCount=-borderWidth/2;xCount,在您的情况下,预处理器可能不会定义
\uuuuu linux\uuuu

根据,您还可以通过运行以下命令来检查预定义了哪些宏:

$touch dummy.cpp
$cpp-dM dummy.cpp

我认为它应该是
\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
在那里确认一下。嗨,molbdnilo谢谢你的回复。不,我也尝试过linux,但它不能工作。它现在可以在unix上工作。但我不知道为什么