Can't link static freetype library in Qt



  • I'm getting LNK2019: unresolved externals for every freetype function referenced in my main.cpp

    Here's the .pro file

    #-------------------------------------------------
    #
    # Project created by QtCreator 2015-12-13T23:52:13
    #
    #-------------------------------------------------
    
    QT       += core gui opengl
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = Tentativo6
    TEMPLATE = app
    
    
    INCLUDEPATH += C:/..../freetype2
    LIBS += C:/..../lib/freetype.lib
    
    SOURCES += \
        main.cpp
    

    I'm calling those functions in my init() function this way:

    FT_Library ft;
        if (FT_Init_FreeType(&ft))
             qDebug() << "ERROR::FREETYPE: Could not init FreeType Library";
        FT_Face face;
        if (FT_New_Face(ft, "C:/Users/Domenico/Desktop/DejaVuLGCSansMono.ttf", 0, &face))
        //other freetype functions
    

    These is my include hierarchy so far:

    #include <QGuiApplication>
    #include <QOpenGLContext>
    #include <QWindow>
    #include <QOpenGLFunctions_3_3_Core>
    #include <stdio.h>
    #include <QMouseEvent>
    #include <QVBoxLayout>
    #include <QTimer>
    #include <QDebug>
    #include <QTime>
    
    #include <ft2build.h>
    #include FT_FREETYPE_H
    
    #include <glm/glm.hpp>
    #include <glm/gtc/matrix_transform.hpp>
    #include <glm/gtc/type_ptr.hpp>
    
    #include "shader.h"
    #include "camera.h"
    

    I already tried to clean up the solution and to run several times qmake before building again, yet I got no luck and I still see those reference errors

    I also tried to specify includes and lib path with -L -l and by using the horrible "add library" wizard, still same errors are showing

    Any help appreciated, thanks in advance



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.