LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2005, 04:15 PM   #1
aceofsource
LQ Newbie
 
Registered: Sep 2005
Posts: 2

Rep: Reputation: 0
OpenGL and GCC


Good night dear friends;

i am writing OPenGL codes and want to compile them by GCC but i can not compile them.When i write the command to compile the program like that;

Code:
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdlib.h>

THE CODES HERE(I assure you,the code blocks are ok and there is nothing wrong with them)
....
...
..
.
and i write

Code:
gcc openglprog.c -o opengl
but it returns with some errors and the compiler says

/temp....
/temp....
..
returned with collect ld 1(this is not thye exact error

.Please someone could help me about compiling OpenGL programs with gcc ,and something to add, i cannot compile my codes that are written by using gtk libs .How can i compile them?Are there any tips you know?

Thank you
 
Old 09-09-2005, 04:35 PM   #2
aceofsource
LQ Newbie
 
Registered: Sep 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Please someone can help me about this?

I really do need help .

for example do i need to write a code like that for compiling

Code:
gcc -L/usr/include/lib -lGL -lglut -lgl -lglu openglprog.c -o openglprog
is that ok are there any more arguments to be passed .
 
Old 09-09-2005, 08:49 PM   #3
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Try something like:

gcc -L/usr/X11R6/lib -I/usr/X11R6/include -lGL -lGLU -lglut openglprog.c -o openglprog

Depending on your setup, you may also need some X11 libraries added to that.
 
  


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
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 02:13 PM
Overwrite Mesa OpenGL with ATI OpenGL Carl-Fredrik Slackware 12 10-01-2004 03:33 PM
Changing from MESA OpenGL to ATI OpenGL tillyoubreakit Linux - Hardware 19 10-07-2003 07:32 PM
OpenGL is needed by plib-1.7.0- but i have opengl ! qwijibow Linux - Newbie 0 08-05-2003 07:12 AM
gcc + opengl gluon Programming 2 10-20-2001 01:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:28 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