LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 12-01-2006, 11:24 AM   #1
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Rep: Reputation: 15
OpenGL in Slackware


Hi,

I'm trying to write OpenGL programs in slack and I'm wondering if slack already has the necessary libraries. If not, where can I get them? I'm writing the programs in C so the compiler shouldn't be an issue.
 
Old 12-01-2006, 12:04 PM   #2
Spinlock
Member
 
Registered: Jan 2006
Location: Missouri
Distribution: Slackware -current, Slackware64 -current, Slackware 12.2
Posts: 135

Rep: Reputation: 15
As far as I can tell, yes. X11-devel should be the package you want.*

*I'm not 100% sure about this.
 
Old 12-01-2006, 12:35 PM   #3
Rayning
Member
 
Registered: Oct 2006
Location: Fayetteville, Arkansas
Distribution: Slackware 11.0
Posts: 36

Rep: Reputation: 15
bit off topic but FF7 was an awesome game.
 
Old 12-01-2006, 01:18 PM   #4
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 110Reputation: 110
Slack always has everything you need, or really easy to get. I'm assuming that you've already got an OpenGL capable card and drivers that go with it. You will either need GLUT or SDL to setup contexts and other stuff.
 
Old 12-02-2006, 12:23 PM   #5
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
I have an ATI rage 128. It's one of the cards listed when you configure X. OpenGL apps run fine.

When I slocate the header files gl.h and glut.h, I find them in /usr/X11R6/include/GL. Can I use these or do I have to get something else? Also, how would I go about including them as headers in the programs I write?

Thanks
 
Old 12-02-2006, 12:57 PM   #6
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 110Reputation: 110
Yep, those are the headers to use
Code:
#include <GL/gl.h>
#include <GL/glut.h>
 
Old 12-02-2006, 01:31 PM   #7
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks. I'm thinking I have to compile with linkers too?
 
Old 12-02-2006, 01:54 PM   #8
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 110Reputation: 110
I'm not sure what you mean. Example?
 
Old 12-02-2006, 03:00 PM   #9
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
well in windows I find that I have to add linker flags for my GL programs even with the includes defined. My programs are not compiling thus far, but examples that I've downloaded from the net are doing fine. So I'm thinking maybe I need to use the -L option in gcc to link the libraries too. I'll figure it out
 
Old 12-02-2006, 03:09 PM   #10
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
I've solved the problem in mere minutes

The command I have to use to compile properly is

gcc -o main main.c -I /usr/X11R6/include/ -L /usr/X11R6/lib/ -lglut -lGL -lGLU -lX11 -lXmu -lXi -lm


 
Old 12-02-2006, 03:34 PM   #11
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 110Reputation: 110
Ah, see that. In *nix, it is custom to compile your stuff into .o files, then link them all together (Windows does that too, but kind of behind your back). With simple one-file programs, the .o step could be skipped like you did in that.

Try removing the -I and -L. Those directories should already be in your include and library paths.
 
Old 12-02-2006, 06:16 PM   #12
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
strangely it doesn't work without linkers. Even with the includes, it did not compile until I linked the libraries directly. I probably just forgot to set a path somewhere.

Thanks for your help. It's working great now
 
Old 12-02-2006, 07:14 PM   #13
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Quote:
Originally Posted by Rayning
bit off topic but FF7 was an awesome game.
I thought the same thing when I saw his handle name...

You might get a kick out of this...

http://jaguarlinux.com/pub/sandbox/final-fantasy.avi

Last edited by jong357; 01-11-2007 at 08:17 PM.
 
Old 12-03-2006, 06:50 AM   #14
Sephiroth
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.1
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jong357
I thought the same thing when I saw his handle name...

You might get a kick out of this...

http://www.4shared.com/dir/722630/9c4d1565/sharing.html

Sorry, I don't have anywhere I can direct link it.

her

and oh man that is great. haha. Thanks
 
Old 12-03-2006, 09:07 AM   #15
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Sorry.. The concept of women getting into Linux is still a little alien to me.

That's from Robot Chicken. One of my most favorite shows.
 
  


Reply

Tags
graphics, opengl, programming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
OpenGL problem in Slackware 10 thundershtorm Linux - Software 2 11-16-2004 09:42 AM
OpenGL and SDL programming with Slackware zsejk Slackware 13 08-03-2004 07:52 PM
Opengl on Slackware Linux Raziel Slackware 9 07-17-2003 04:19 PM
OpenGL w/ NVIDIA & Slackware 9.0 c_you_l8r Slackware 4 06-07-2003 12:08 AM
openGL, Nvidia, and Slackware contrasutra Linux - Software 3 04-04-2003 10:14 PM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration