Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't link static freetype library in Qt
Qt 6.11 is out! See what's new in the release blog

Can't link static freetype library in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
freetypelinkinglinkererrorqmake
1 Posts 1 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Row_Rebel
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved