LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-26-2012, 11:28 PM   #1
kcor
LQ Newbie
 
Registered: Sep 2006
Location: Small City
Distribution: Slackware 10.2, 14.1
Posts: 15

Rep: Reputation: 0
Simple OpenGL program won't compile


Hi all,

I just installed slackware 14.0 and am now trying to compile a simple openGL cube program. I've verified I have the required OpenGL files but I receive the following output when I attempt to run 'make' in the same folder as my cpp files.

Here is the entire output:

Code:
make 
g++ -Wall -o cube main.cpp imageloader.cpp -lglut
imageloader.cpp: In function 'Image* loadBMP(const char*)':
imageloader.cpp:141:2: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: /tmp/ccJVh8Br.o: undefined reference to symbol 'glNormal3f'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: note: 'glNormal3f' is defined in DSO /usr/lib64/libGL.so.1 so try adding it to the linker command line
/usr/lib64/libGL.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [cube] Error 1
Any ideas why this is happening ? Thanks in advance!
 
Old 10-27-2012, 03:37 AM   #2
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 497

Rep: Reputation: 119Reputation: 119
the output is typical for a missing link library on the command line. the first google hit suggests -lGL -lGLU -lglut.
 
Old 10-27-2012, 08:36 AM   #3
kcor
LQ Newbie
 
Registered: Sep 2006
Location: Small City
Distribution: Slackware 10.2, 14.1
Posts: 15

Original Poster
Rep: Reputation: 0
thanks! Come to find out I was linking outdated libraries. I changed my makefile to link -lGLU and -lglut
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot compile OpenGL program because libGL.a is missing lasindi Slackware 4 04-12-2009 04:09 PM
Simple C++ Program: Program Compiles But Won't Run (Segmentation Fault) violagirl23 Programming 3 01-09-2008 12:09 AM
OpenGL program compile error with gcc 4.1.1 and Mesa 6.5.2 iam_techno Linux - Software 1 01-07-2007 05:25 PM
simple program using openGL in GLUT poeta_boy Programming 14 07-11-2004 04:40 PM
simple opengl program tundra Programming 6 06-27-2002 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration