LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2004, 08:21 AM   #1
Conor_Bloodmoon
LQ Newbie
 
Registered: Nov 2004
Distribution: mandrake 10
Posts: 3

Rep: Reputation: 0
Mandrake 10 and opengl




Ok after alot of work last night to setup partition and install mandrake i finally have it running but.....

I'm trying to do opengl programming for a class. The problem is they never taught us how to set it all up so we could do it at home. So i have been working on the university computer where everything is nicely setup and we are provided make files and everything. The problem is i need to do a project and need to work on it at home.

So.... i need to know how to install glut/mesa/whatever else i need so i can work on this stuff at home. I need help urgently as i only have about a week left so if anyone out there can explain it to me very very simply what i need to do it would be much apperciated.

P.S. How do you make yourself root outside of the console so you can move files around i.e. into /usr(it won't let me)?

P.P.S. here is a small example of the code stuff i need to run

#include <GL/glut.h>
#include "render.h"
#include "objects.h"

static GLfloat white_colour[] = { 1.0, 1.0, 1.0 };
static GLfloat red_colour[] = { 1.0, 0.0, 0.0 };
static GLfloat filter_colour[] = { 1.0, 0.78, .25};

void Cigarette()
{
glPushMatrix();
setColour(white_colour);
glTranslatef(0,4,0);
glScalef(.5,4,.5);
drawCylinder(20);
glPopMatrix();


glPushMatrix();
setColour(filter_colour);
glTranslatef(0,1,0);
glScalef(.5,2,.5);
drawCylinder(20);
glPopMatrix();

glPushMatrix();
setColour(red_colour);
glTranslatef(0,6.005,0);
glScalef(.5,.01,.5);
drawCylinder(20);
glPopMatrix();

}
void Render()
{
Cigarette();
}

And an example of the make file we were given(no idea what this stuff does so if you could tell me what i need to change here)



TARGET = lab06b

DEBUG = -g
CFLAGS = ${DEBUG}
OBJS = main.o Ball.o BallAux.o BallMath.o render.o objects.o texture.o

# WHERE TO FIND CERTAIN HEADERS AND LIBS

# Linux
DIR_HEADERS = \
-I/usr/local/Mesa-6.1/include
LINK_LIBRARIES = -L /usr/X11R6/lib \
-L/usr/local/Mesa-6.1/lib \
-lglut -lXmu -lGLU -lGL -lX11 -lm

#Linux compile
linux: ${OBJS}
$(CC) -o ${TARGET} $(CFLAGS) $(DIR_HEADERS) ${OBJS} ${LINK_LIBRARIES}

clean:
- rm core render.o main.o ${TARGET}

#SUFFIX RULES: any file with one of these suffixes is significant
.SUFFIXES: .o .c

# SUFFIX RULE: how to turn a .c file into a .o file
.c.o:
$(CC) -c $(CFLAGS) ${DIR_HEADERS} $*.c -o $*.o
 
Old 11-27-2004, 05:30 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Which packages do you have installed? Make sure you have the compiler (gcc), devels for X and that should be probably all. To test what you have simply try to build the application. If you don't have everything you'll get errors. Paste them here.
 
Old 11-27-2004, 05:49 PM   #3
Conor_Bloodmoon
LQ Newbie
 
Registered: Nov 2004
Distribution: mandrake 10
Posts: 3

Original Poster
Rep: Reputation: 0
I used tarballs unzipped and in the case of mesa did make -linux86(or something similiar). I think i have everything in the right place now(or rather i hope i been setting this stuff up or trying for the last 6 hours). I had to transfer file from my home directory in usr/local via root in console(this is what i mean by not being able to access root files i am in my home directory and no usr/bin/..... type directories seem to be applicable to me). Now when i try to run it it seems the the libraries are loading but then i get this error

"/usr/bin/ld cannot find -lglut collect 2 ld returned 1 exit status"

i assume this is a problem with the make file. Also if i try to run a file that has prevoiusly been made i.e. in college it runs fine but if i change anything and try to make errors come up.


P.S. Plan was to work on project all weekend get it all done so i can worry about study and other stuff. Since friday 4:00pm i've managed to partition drive(had lots of problems with this) install linux and install nvidia driver thats pretty much it its now 11:42 pm saturday...........its so very frustrating *sigh*
 
Old 11-27-2004, 06:04 PM   #4
zorba4
Member
 
Registered: Feb 2004
Location: Paris
Posts: 398

Rep: Reputation: 31
Concerning the error message, "-l glut" in the makefile says that your program uses the glut library. And the error message says that the glut library is not in your system. So, make a "google" search or a "linuxquestions" search in order to see where you can catch that library and how to install it.

In order to be root in your "normal user" console, just type "su root" and you will be able to write anywhere, including in /lib or /usr/lib. Unfortunately, you can do that only on your computer, because you have to know the root user password.
 
Old 11-28-2004, 09:34 AM   #5
Conor_Bloodmoon
LQ Newbie
 
Registered: Nov 2004
Distribution: mandrake 10
Posts: 3

Original Poster
Rep: Reputation: 0
Ok each time i try to run the make file i get a series of warning "APIENTRY" redifined and warning this is the location of a previous definition messages. I have no idea whats causing these. Also after that i get the /usr/bin/ld cannot find -lglut collect 2 ld returned 1 exit status why is it looking in usr/bin ??
 
Old 11-28-2004, 09:43 AM   #6
zorba4
Member
 
Registered: Feb 2004
Location: Paris
Posts: 398

Rep: Reputation: 31
"tlglut" il a compiler option saying something like "use the library named /usr/lib/glut.h".
And the error message means "cannot find that library".
This means that you did not install the glut library, or installed it in a bad location.
Just type "find / -print |grep -i glut" to see where the libraries are installed.
 
  


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
opengl programming in Mandrake 10.1 vivinuthappa Programming 2 08-12-2005 06:11 AM
Mandrake 10.1 OpenGL Screensavers eponymous Linux - Software 2 12-14-2004 10:10 AM
OpenGL problem in Mandrake 8.2 manikk Linux - Newbie 2 03-28-2004 09:03 AM
OpenGL on Mandrake? Ekim Gram Programming 3 06-01-2003 02:51 PM
GeForce2 MX, Mandrake 8.0, & OpenGL paulisdead Linux - Software 1 06-06-2001 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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