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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:15:04+00:00 2026-06-17T05:15:04+00:00

I am trying to setup OpenGL developing environment on Ubuntu.I installed all the libs

  • 0

I am trying to setup OpenGL developing environment on Ubuntu.I installed all the libs including GLFW as I don’t want to use GLUT.GLEW lib has been installed too.I am trying to set it all in NetBeans.I have never used it before and currently I am getting :

undefined reference to `glfwInit’ error while running this simple code:

#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <GL/glew.h>
#include <GL/glfw.h>
#include "glm.hpp"
using namespace std;
using namespace glm;

int main(int argc, char** argv) {


 /*      init GLFW         */
    if(!glfwInit()){

        fprintf(stderr,"failed to init GLFW");

     }
    return 0;
}

I am sure it is linker related problem.So I have added libglfw.a to Linker->Libraries and then got even more errors like these:

make[2]: Entering directory /home/sasmaster/NetBeansProjects/OpenGLDemo'
mkdir -p dist/Debug/GNU-Linux-x86 g++ -o dist/Debug/GNU-Linux-x86/opengldemo build/Debug/GNU-Linux-x86/main.o /usr/lib/libglfw.a
/usr/lib/libglfw.a(window.o): In function
glfwOpenWindow’:
/usr/lib/libglfw.a(x11_init.o): In function _glfwPlatformInit':
/usr/lib/libglfw.a(x11_init.o): In function
_glfwPlatformInit’:
/usr/lib/libglfw.a(x11_init.o): In function _glfwPlatformInit':
/usr/lib/libglfw.a(x11_init.o): In function
_glfwPlatformInit’:
/usr/lib/libglfw.a(x11_init.o): In function _glfwPlatformTerminate':
/usr/lib/libglfw.a(x11_init.o): In function
_glfwPlatformTerminate’:
/usr/lib/libglfw.a(x11_window.o): In function translateKey':
/usr/lib/libglfw.a(x11_window.o): In function
translateKey’:
/usr/lib/libglfw.a(x11_window.o): In function translateKey':
/usr/lib/libglfw.a(x11_window.o): In function
translateChar’:
………..
……………………

What else should I link or install?

Update:
Here it is said one should add LIBRARIES=’-pthread -lglfw -lGL -lX11 -lGLU -lXxf86vm’
But where should I add those in NetBeans properties? I tried put into the MakeFile and “linker options” too and nothing helped.

Update1
Compiling the main.cpp manually using this command:

**g++ main.cpp  -o Game -lglfw -lGL -lGLU -lX11 -lpthread -lXxf86vm -lm**

Compiles fine.How do I link all these libs via NetBeans???

  • 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-17T05:15:05+00:00Added an answer on June 17, 2026 at 5:15 am

    I figured out the solution.For those interested:
    Openg Project properties.Then “Linker” ->“Libraries”.
    In the Libraries dialog:
    Click “Add Option” -> “Other Option”.
    In the textfield insert these params:

    -lGLEW -lglfw -lGL -lGLU -lX11 -lpthread -lXxf86vm -lm

    I guess lGLU is needed only if you use the old OpenGL version.

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

Sidebar

Related Questions

I'm trying to use OpenGL and GLFW with Derelict3 for the D language, but
I am trying to use GLSL with openGL 2.0. Can anyone give me a
I'm trying to get multisampling to work in my OpenGL ES app. Framebuffer setup
I'm trying to setup VC++ to compile code with OpenGL 4.1 functionality. I downloaded
Im trying to draw a globe in Android, I use OpenGL for this. However
Trying to setup a personal image upload/downloader webpage. I've viewed the msdn article on
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
Trying to setup some validation on the add to cart button for the dropdown
Trying to setup and get going with the RestKit library for a cocoa project
Im trying to setup my asp.net mvc page like the following image: The header

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.