Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8504493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:02:51+00:00 2026-06-11T02:02:51+00:00

Coming from PHP, this is my first experience with C/C++ (so go easy on

  • 0

Coming from PHP, this is my first experience with C/C++ (so go easy on me). I’m following this tutorial to write a simple script using the FreeType library. The following compiles just fine:

#include <ft2build.h>
#include FT_FREETYPE_H

main() {
    FT_Library library;
    FT_Face face;
}

This tells me that the FreeType library is readily available to the compiler. However, things break once I try to use any methods. For example, take the following script:

#include <ft2build.h>
#include FT_FREETYPE_H

main() {

    int error;

    FT_Library library;
    error = FT_Init_FreeType(&library);
    if (error) {}

    FT_Face face;
    error = FT_New_Face(library, "/usr/share/fonts/truetype/arial.ttf", 0, &face);
    if (error == FT_Err_Unknown_File_Format) {
        printf("Font format is unsupported");
    } else if (error) {
        prinft("Font file is missing or corrupted");
    }
}

This script produces the following error upon compiling:

#gcc render.c -I/usr/include/freetype2
/tmp/cc95255i.o: In function `main':
render.c:(.text+0x10): undefined reference to `FT_Init_FreeType'
render.c:(.text+0x30): undefined reference to `FT_New_Face'
collect2: ld returned 1 exit status

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:02:53+00:00Added an answer on June 11, 2026 at 2:02 am

    Those are link errors. If they include a Makefile with the demo you are better off using that. Otherwise, you need to add -L and -l options to your compile command line so the compiler (actually the linker, which gets invoked by the compiler behind the scene) knows where to find the FreeType library.

    The -L option gives the path to where the code for the library exists. For example

    -L/usr/local/lib  
    

    And the -l option gives the name of the library. The library named with the -l option is specified in a shortened form, that is you leave off the “lib” in the front and the “.a” in the back. So for example, if the FreeType library was stored in file libfreetype.a , it would show in the -l option as

    -lfreetype
    

    e.g.:

    gcc render.c -I/usr/include/freetype2 -L/usr/local/lib -lfreetype
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Coming from PHP with some Java Struts 2.0 experience any tips/tricks on learning GWT?
Hi i am using PHP to store the timezone.The timezone coming from dropdown and
i'm creating a simple slideshow. 4 images coming from db by php stored in
Using: Ubuntu 11.04 Django 1.3 Python 2.7 Following the tutorial at Writing your first
I am using this tutorial to learn push notification. <?php // Put your device
I am working on a validator library, coming from PHP I would like to
Coming from a PHP background, I'm used to writing small functions that return a
I am coming from a PHP background and I am familiar with OOP concepts,
I'm trying to parse an XML coming from an php request URI: http://caracasfutbolclub.com/service/news.php .
Note: I'm relatively new to Objective-C and am coming from Java and PHP. Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.