To render text with OpenGL, I need the FreeType library. I found out that this library is included with Qt 3rd party packages, located in :
/opt/Qt5.0.1/5.0.1/Src/qtbase/src/3rdparty/freetype/include/freetype
/opt/Qt5.0.1/5.0.1/Src/qtbase/src/3rdparty/freetype/include/freetype
To copy to clipboard, switch view to plain text mode
To test if the library is successfully working, I ran the below code snippet:
#include <ft2build.h>
#include FT_FREETYPE_H
FT_Library ft;
if(FT_Init_FreeType(&ft)) {
fprintf(stderr, "Could not init freetype library\n");
return 1;
}
#include <ft2build.h>
#include FT_FREETYPE_H
FT_Library ft;
if(FT_Init_FreeType(&ft)) {
fprintf(stderr, "Could not init freetype library\n");
return 1;
}
To copy to clipboard, switch view to plain text mode
However, I get the following errors:
/usr/local/include/freetype2/freetype/freetype.h:298: error: 'FT_Pos' does not name a type
/usr/local/include/freetype2/freetype/freetype.h:34: error: #include expects "FILENAME" or <FILENAME>
/usr/local/include/freetype2/freetype/freetype.h:656: error: a function call cannot appear in a constant-expression
.
.
.
/usr/local/include/freetype2/freetype/freetype.h:298: error: 'FT_Pos' does not name a type
/usr/local/include/freetype2/freetype/freetype.h:34: error: #include expects "FILENAME" or <FILENAME>
/usr/local/include/freetype2/freetype/freetype.h:656: error: a function call cannot appear in a constant-expression
.
.
.
To copy to clipboard, switch view to plain text mode
any hints would be appreciable.
Cheers,
Bookmarks