Hi,
I'm new at Codeblocks and I try to get this example (http://www.freetype.org/freetype2/docs/tutorial/example1.c) of the FreeType2 Documentation (http://www.freetype.org/freetype2/docs/tutorial/step1.html) working. The problem might be too easy for you, but as a beginner I have problems in understanding these error messages:
-------------- Build: Debug in test ---------------
Linking console executable: bin\Debug\test.exe
obj\Debug\example1.o: In function `main':
Y:/test/test/example1.c:98: undefined reference to `FT_Init_FreeType'
Y:/test/test/example1.c:101: undefined reference to `FT_New_Face'
Y:/test/test/example1.c:105: undefined reference to `FT_Set_Char_Size'
Y:/test/test/example1.c:125: undefined reference to `FT_Set_Transform'
Y:/test/test/example1.c:128: undefined reference to `FT_Load_Char'
Y:/test/test/example1.c:144: undefined reference to `FT_Done_Face'
Y:/test/test/example1.c:145: undefined reference to `FT_Done_FreeType'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
7 errors, 0 warnings
What I know is that all the errors are functions. The first function is "FT_Init_FreeType" which is here:
error = FT_Init_FreeType( &library ); /* initialize library */ //
/* error handling omitted */
error = FT_New_Face( library, argv[1], 0, &face ); /* create face object */
/* error handling omitted */
/* use 50pt at 100dpi */
error = FT_Set_Char_Size( face, 50 * 64, 0,
100, 0 ); /* set character size */
/* error handling omitted */
slot = face->glyph;
I have added the Path Y:\freetype-2.3.5\freetype-2.3.5 with Freetype Headers to the Compiler Search Directories, which can be found under Settings-->Compiler and Debugger Settings-->Search Directories-->Compiler. Thus, MingGW should be able to find all the necessary things to compile that example properly.
The FreeType Headers are included with:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ft2build.h>
#include FT_FREETYPE_H
After reading websites related to linkers, I assume that it perhaps has something to do with a missing dll or so where the missing functions can be found. As said before I'm new at Codeblocks and i have never changed something in the compiler options before.
Can anyone tell me why these error messages occur?