LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 09-16-2004, 12:07 PM   #1
tethysgods
Member
 
Registered: May 2004
Posts: 166

Rep: Reputation: 17
Mesa-Glut compilation problem


OK I should use a makefile, but my first attempt at using mesa on a simple
Hello.cpp programme using



icc -static -o Hello Hello.cpp -L/usr/X11R6/lib -lX11 -lglut -lMesaGL -lMesaGLU -lXext -lm -lXmu


gives me a huge list of errors like

/usr/lib/libglut.a (glut event.o) glah blah
:undefined reference to function `Xflush'

As far as I can see I have all the libraries I need, I find Xflush is a basic Xlib function, but should -lX11 see to that?

#include <GL/gl.h>
#include <GL/glut.h>


/* Called when window needs to be redrawn */
void redraw()
{
glClear(GL_COLOR_BUFFER_BIT); /* clear screen to black */
/* just draw a boring red triangle */
glBegin(GL_TRIANGLES);
glColor3f(1.f, 0.f, 0.f);
glVertex2f(-.5f, -.5f);
glVertex2f( .5f, -.5f);
glVertex2f( 0.f, .5f);
glEnd();
glFlush();
}

/* Parse arguments, and set up interface between OpenGL and window system */
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowSize(512, 512);
glutInitDisplayMode(GLUT_RGBA);
(void)glutCreateWindow("simple program");
glutDisplayFunc(redraw);
glutMainLoop();
}
 
Old 09-16-2004, 12:33 PM   #2
orgcandman
Member
 
Registered: May 2002
Location: dracut MA
Distribution: Ubuntu; PNE-LE; LFS (no book)
Posts: 594

Rep: Reputation: 102Reputation: 102
try putting the -o at the end. gcc and g++ sometimes do wierd things regarding specification of libraries and library paths if your -o comes first.

that's all I can think of.

aaron
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mesa, glut and compiling opengl adhara Programming 3 05-08-2004 05:14 AM
mesa glut libraries adhara Linux - Software 6 05-08-2004 04:45 AM
Compiling a simple Mesa/GLUT program Bojdom Linux - Software 2 02-02-2003 04:19 PM
Installing Mesa & Mesa-demos... bozotix Linux - Software 2 05-09-2002 12:55 AM
glut/mesa/openGL gurra Programming 1 10-10-2001 03:36 PM


All times are GMT -5. The time now is 05:23 AM.

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