opengl glfw glew undefined reference

Nyap

HTML Noob
OP
Banned
Joined
Jan 13, 2016
Messages
971
Trophies
0
Age
53
Location
That Chaos Site
XP
482
Country
so yeah I was really looking forward to learning opengl until I discovered its a fucking nightmare :wacko:
here's the example code I'm trying to build
Code:
#include <GL/glew.h> // include GLEW and new version of GL on Windows
#include <GLFW/glfw3.h> // GLFW helper library
#include <stdio.h>

int main () {
  // start GL context and O/S window using the GLFW helper library
  if (!glfwInit ()) {
  fprintf (stderr, "ERROR: could not start GLFW3\n");
  return 1;
  }

  // uncomment these lines if on Apple OS X
  /*glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 3);
  glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 2);
  glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  glfwWindowHint (GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);*/

  GLFWwindow* window = glfwCreateWindow (640, 480, "Hello Triangle", NULL, NULL);
  if (!window) {
  fprintf (stderr, "ERROR: could not open window with GLFW3\n");
  glfwTerminate();
  return 1;
  }
  glfwMakeContextCurrent (window);

  // start GLEW extension handler
  glewExperimental = GL_TRUE;
  glewInit ();

  // get version info
  const GLubyte* renderer = glGetString (GL_RENDERER); // get renderer string
  const GLubyte* version = glGetString (GL_VERSION); // version as a string
  printf ("Renderer: %s\n", renderer);
  printf ("OpenGL version supported %s\n", version);

  // tell GL to only draw onto a pixel if the shape is closer to the viewer
  glEnable (GL_DEPTH_TEST); // enable depth-testing
  glDepthFunc (GL_LESS); // depth-testing interprets a smaller value as "closer"

  /* OTHER STUFF GOES HERE NEXT */

  // close GL context and any other GLFW resources
  glfwTerminate();
  return 0;
}
and here's the command I'm using
g++-6 -o demo main.cpp /usr/lib64/libGLEW.a /usr/local/lib/libglfw3.a -I include -lGL -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lm
output:
/usr/bin/ld: /usr/local/lib/libglfw3.a(vulkan.c.o): undefined reference to symbol '[email protected]@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
plz help
edit: I just tried compiling the examples that come with GLFW using the included makefile and it works fine
 
Last edited by Nyap,

Nyap

HTML Noob
OP
Banned
Joined
Jan 13, 2016
Messages
971
Trophies
0
Age
53
Location
That Chaos Site
XP
482
Country
man pppppppplllllllllllzzzzzzz these demos are so cool why did I have to get stuck like right at the start
84KYdad.png
 

You may also like...

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    Now that's a problem lol
  • K3N1 @ K3N1:
    Did your record skip?
  • Psionic Roshambo @ Psionic Roshambo:
    He broke all kinds of records
  • M4x1mumReZ @ M4x1mumReZ:
    Vinyl is more for the collectors than anything honestly.
  • M4x1mumReZ @ M4x1mumReZ:
    Also don't use unknown vinyl players which have the cheap mechanism, as the needle can damage your vinyls.
  • M4x1mumReZ @ M4x1mumReZ:
    Invest into a more good quality player than anything.
  • M4x1mumReZ @ M4x1mumReZ:
    Audio-Technica is a reputable brand.
  • K3N1 @ K3N1:
    Something old was mentioned and all of a sudden we're all experts on it
    +1
  • Veho @ Veho:
    Hefalump syndrome.
  • K3N1 @ K3N1:
    Elephants are cool
  • K3N1 @ K3N1:
    I wonder what Will Smith is going to say about YouTube this year
  • Veho @ Veho:
    He's gonna slap his mobile phone.
    +1
  • K3N1 @ K3N1:
    Or get into a random argument with someone he's never met before on Facebook
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Him getting pissed after someone mentions his wife.
  • Psionic Roshambo @ Psionic Roshambo:
    Arguing on the internet is like winning the special Olympics.... Even if you win your still retarded
    +1
  • K3N1 @ K3N1:
    Nuh uh
  • K3N1 @ K3N1:
    Bought mw2 don't ask why
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Time to trigger 9-year olds on Xbox Live.
  • K3N1 @ K3N1:
    And pick up sexy moms
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    You wish
  • K3N1 @ K3N1:
    Already got yours ;O
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Jokes on you, I don't have one :D
  • M4x1mumReZ @ M4x1mumReZ:
    And neither do you
  • K3N1 @ K3N1:
    I wish I didn't have one she a dick
    K3N1 @ K3N1: I wish I didn't have one she a dick