我正在尝试从 sourceforge 编译 hosts3d,它确实可以编译,但会产生几个缩小错误。我不知道如何解决这个问题,但任何帮助将不胜感激。我怀疑我可以下载以前版本的编译器,我可能最终会这样做,但现在...... c++11
g++ -Wall -O2 -c -o src/glwin.o src/glwin.cpp src/glwin.cpp: 在成员函数'int MyGLWin::AddInput(int, int, unsigned int, int, const char*, bool) ':src/glwin.cpp:983:147:警告:在 C++11 [-Wnarrowing] glin_obj glin = {GLWIN_INPUT , lastWin, lower, names++, left, top, cwidth, strlen(text), (strlen(text) > cwidth ? strlen(text) - cwidth : 0), max};
//create input object, return name of input object
int MyGLWin::AddInput(int left, int top, unsigned int cwidth, int max, const char *text, bool lower)
{
if (!lastWin) return -1; //check parent window object exists
glin_obj glin = {GLWIN_INPUT, lastWin, lower, names++, left, top, cwidth, strlen(text), (strlen(text) > cwidth ? strlen(text) - cwidth : 0), max};
strcpy(glin.text, text); //default text
currInput = glin.name; //set input object focus (for keys)
lastInput = (glin_obj *)GLWinLL.Write(new glin_obj(glin));
return glin.name;
}