moshy
June 8th, 2007, 03:37 AM
I'm trying to compile a demo C++ program which uses OpenGL and FTGL for fonts. (It also uses Glut but normally I would use SDL).
I've installed FTGL on my computer after downloading it from the internet. There's also an ftgl-dev package in the repositories but that only contains header files. Anyway when compiling I don't know how to now link the demo file to the FTGL library.
Currently it can find the header files, but then I get this error
ftgl_demo.cpp: In function ‘void my_init(const char*)’:
ftgl_demo.cpp:22: error: no matching function for call to ‘FTGLOutlineFont::FTGLOutlineFont()’
/usr/include/FTGL/FTGLOutlineFont.h:33: note: candidates are: FTGLOutlineFont::FTGLOutlineFont(const unsigned char*, size_t)
/usr/include/FTGL/FTGLOutlineFont.h:25: note: FTGLOutlineFont::FTGLOutlineFont(const char*)
/usr/include/FTGL/FTGLOutlineFont.h:18: note: FTGLOutlineFont::FTGLOutlineFont(const FTGLOutlineFont&)
I know where the library is, it's in
/usr/local/lib/libftgl.a
which contains the object files, and
/usr/local/lib/libftgl.la
I have no idea what this file is, as I know nothing about libraries and how to link to them. This is my Makefile which I hacked together.
make : ftgl_demo.o
g++ -L/usr/local/lib/libftgl.a ftgl_demo.o -o ftgl_demo
ftgl_demo.o : ftgl_demo.cpp
g++ -c -I/usr/include/FTGL ftgl_demo.cpp
Could somebody please tell me what I'm doing wrong, or some sites which completely explain how this works, or even better how to set it up so I don't have to specify actual paths, like when I do -lGL -lGLU -lSDL_image etc.
I've installed FTGL on my computer after downloading it from the internet. There's also an ftgl-dev package in the repositories but that only contains header files. Anyway when compiling I don't know how to now link the demo file to the FTGL library.
Currently it can find the header files, but then I get this error
ftgl_demo.cpp: In function ‘void my_init(const char*)’:
ftgl_demo.cpp:22: error: no matching function for call to ‘FTGLOutlineFont::FTGLOutlineFont()’
/usr/include/FTGL/FTGLOutlineFont.h:33: note: candidates are: FTGLOutlineFont::FTGLOutlineFont(const unsigned char*, size_t)
/usr/include/FTGL/FTGLOutlineFont.h:25: note: FTGLOutlineFont::FTGLOutlineFont(const char*)
/usr/include/FTGL/FTGLOutlineFont.h:18: note: FTGLOutlineFont::FTGLOutlineFont(const FTGLOutlineFont&)
I know where the library is, it's in
/usr/local/lib/libftgl.a
which contains the object files, and
/usr/local/lib/libftgl.la
I have no idea what this file is, as I know nothing about libraries and how to link to them. This is my Makefile which I hacked together.
make : ftgl_demo.o
g++ -L/usr/local/lib/libftgl.a ftgl_demo.o -o ftgl_demo
ftgl_demo.o : ftgl_demo.cpp
g++ -c -I/usr/include/FTGL ftgl_demo.cpp
Could somebody please tell me what I'm doing wrong, or some sites which completely explain how this works, or even better how to set it up so I don't have to specify actual paths, like when I do -lGL -lGLU -lSDL_image etc.