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 6720101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:10:20+00:00 2026-05-26T09:10:20+00:00

I am using GLFW libraries in my *.c program. #include <GL/glfw.h> #include <stdlib.h> int

  • 0

I am using GLFW libraries in my *.c program.

    #include <GL/glfw.h>
    #include <stdlib.h>

    int main(void)
    {
        int running = GL_TRUE;
        int k=0;
.....
...
..

The command I use to compile is:

gcc test1.c -o test1 -lglfw

My question is that, since this line is present:

#include <GL/glfw.h>

why do I have to pass -lglfw to gcc?

  • 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-05-26T09:10:20+00:00Added an answer on May 26, 2026 at 9:10 am

    GL/glfw.h is a header file, it declares all the types, constants, functions, you know the drill, it’s to make the compiler know what code to generate and to make it not complain about unknown identifiers. libglfw is a library that contains the actual binary code (or stubs that will be bound later by the dynamic linker, or something like that), you have to link with it to make the linker not complain about unresolved symbols.

    It’s possible for the header to contain the actual source code of the library (so the compiler will generate the binary code over and over again for each translation unit where the library is used), it’s called a header-only library then, but in the C world such libraries aren’t something that you can find often and this particular library is not header-only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my multithraded application, I'm using a sleep() function (the one from the GLFW
Using PyObjC , you can use Python to write Cocoa applications for OS X.
I am using GLFW as GUI for OpenGL projects. I am using my red
Why can't I get anything to display with this code? #include <iostream> #include GL/glfw.h
While making an OpenGL toolkit using GLFW and Cython I stumbled upon a very,
I am trying to load and draw a 2d texture using OpenGL with GLFW
I'm using GLFW for creating OpenGL context and capturing user's input and I wanted
Using just python, is it possible to possible to use a USB flash drive
I'm writing Snake in C++, using OpenGL and GLFW. I'm trying to implement a
I want to use the OpenGL library, GLFW, to render a window but also

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.