emscripten-ports / FreeType

6 stars 6 forks source link

"ft2build.h" file not found #2

Closed lukabavdaz closed 7 years ago

lukabavdaz commented 7 years ago

I tried to use Freetype by building with the "-s USE_FREETYPE=1" build command. The library is properly downloaded but none of the files can be found by the program. I applied the same method to successfully use the SDL and SDL_TTF ports. The following is the code I use to test if it works:

#include <iostream>
#include <ft2build.h>
#include FT_FREETYPE_H
int main() {
    FT_Library  library;
    int error = FT_Init_FreeType( &library );
    if(error) {
        std::cout << "Freetype init error\n";
    } else {
        std::cout << "Freetype init success\n";
    }
    return 0;
}

What am I doing wrong?

kripken commented 7 years ago

That works for me on the incoming branch (1.36.11). Which version are you on?

lukabavdaz commented 7 years ago

I'm using version 1.35.0, which is the version that is installed when using the "emsdk install latest" command. I tried updating by installing sdk-tag-1.36.11-64bit, but that has been unsuccessful thus far (currently getting errors related to LLVM: http://imgur.com/a/hoJtJ, but I will open a separate issue if I can't solve it by myself).

I did notice that the file not found build error happens before downloading the Freetype library. It may also be worth noting that I am also using "-O2" and "--memory-init-file 0" commands.

lukabavdaz commented 7 years ago

I managed to build and configure the 1.36.11 SDK. However, I still get the same "file not found" error when I try to use the Freetype port. I am now building without -O2 as it does not work yet (I get the same errors as described in issue kripken/emscripten/issues/4506).

lukabavdaz commented 7 years ago

I solved the problem and checked that it also works with version I previously used (1.35.0). The problem had to do with my build commands, and now it's a mystery to me why the SDL port worked in the first place...

pinguin999 commented 3 years ago

@lukabavdaz Can you post what you have changed? I have the same problem.