Hi,
This is literally my first time trying to add a library into my C/C++ program. The library I want to add is FreeType. Also, I'm using Windows 7, if that matters, and MinGW-64 bit compiler.
So far I have managed to get the include path correctly.
Code:
#include "jni.h"
#include <iostream>
#include <ft2build.h>
#include FT_FREETYPE_H
extern "C" JNIEXPORT void JNICALL Java_FreeType_enter(JNIEnv *env, jobject obj, jint integer)
{
FT_Library library;
std::cout << "Hello world!" << std::endl;
}
I get the following code to compile correctly with this line:
Code:
g++ -Werror -Ilibs/jni/include -Ilibs/freetype/include -shared -o lib.dll FreeType.cpp
This code compiles successfully and the program executes properly.
My problem comes when I actually need to use FreeType functions. When I add this line of code to my 'enter'
Code:
FT_Init_FreeType( &library );
compiler gives me an error that reference to FT_Init_FreeType is undefined.
I have found this topic on stackoverflow freetype - C compiler error: Undefined reference to 'FT_Init_FreeType' - Stack Overflow, however it didn't help me much, as I tried many different combination of -L and -l parameters, and compiler kept saying that it cannot find the file specified.
Sorry if I posted in the wrong board, and thank you for your time in advance!