GLUI library  in VS 2008.

loopfinity
loopfinity used Ask the Experts™
on
Hi there,

I have problem about glui library.
I follow the instructions whic are writen in these links   :  http://www.cs.purdue.edu/homes/cvanegas/cs334/jan16_18.htm  and   http://web.engr.oregonstate.edu/~mjb/cs553/gettingglut.html , but
 the program, which is attached, generates errors.

  1- can you recommend another way to get GLUI for VS 2008  or another User Interface library  ?
 

/****************************************************************************
A simple GLUT program using the GLUI User Interface Library
This program sets up a checkbox and a spinner, both with live variables.
No callbacks are used.
-----------------------------------------------------------------------
9/9/98 Paul Rademacher (rademach@cs.unc.edu)
****************************************************************************/
#include
<string.h> 
#include
<GL/glut.h> 
#include
<GL/glui.h> 
/** These are the live variables passed into GLUI ***/
int
wireframe = 0; 
int
segments = 8; 
int
main_window; 
 
/***************************************** myGlutIdle() ***********/
void
myGlutIdle( void ) 
{
/* According to the GLUT specification, the current window is 
undefined during an idle callback. So we need to explicitly change
it if necessary */
if ( glutGetWindow() != main_window ) 
glutSetWindow(main_window);
glutPostRedisplay();
}
 
/**************************************** myGlutReshape() *************/
void
myGlutReshape( int x, int y ) 
{
float xy_aspect; 
xy_aspect = (
float)x / (float)y; 
glViewport( 0, 0, x, y );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -xy_aspect*.08, xy_aspect*.08, -.08, .08, .1, 15.0 );
glutPostRedisplay();
}
/***************************************** myGlutDisplay() *****************/
void
myGlutDisplay( void ) 
{
static float rotationX = 0.0, rotationY = 0.0; 
glClearColor( .9f, .9f, .9f, 1.0f );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
/*** Rotate the object ***/ 
rotationX += 3.3f;
rotationY += 4.7f;
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -1.0 );
glRotatef( rotationY, 0.0, 1.0, 0.0 );
glRotatef( rotationX, 1.0, 0.0, 0.0 );
/*** Now we render object, using the variables 'segments' and 
'wireframe'. These are _live_ variables, which are transparently
updated by GLUI ***/
if ( wireframe ) 
glutWireTorus( .2,.5,16,segments );
else 
glutSolidTorus( .2,.5,16,segments );
glutSwapBuffers();
}
 
/**************************************** main() ********************/
void
main(int argc, char* argv[]) 
{
/****************************************/ 
/* Initialize GLUT and create window */ 
/****************************************/ 
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutInitWindowPosition( 50, 50 );
glutInitWindowSize( 300, 300 );
main_window = glutCreateWindow( 
"GLUI Example 1" ); 
glutDisplayFunc( myGlutDisplay );
glutReshapeFunc( myGlutReshape );
/****************************************/ 
/* Set up OpenGL lights */ 
/****************************************/ 
GLfloat light0_ambient[] = {0.1f, 0.1f, 0.3f, 1.0f};
GLfloat light0_diffuse[] = {.6f, .6f, 1.0f, 1.0f};
GLfloat light0_position[] = {1.0f, 1.0f, 1.0f, 0.0f};
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
/****************************************/ 
/* Enable z-buferring */ 
/****************************************/ 
glEnable(GL_DEPTH_TEST);
 
/****************************************/ 
/* Here's the GLUI code */ 
/****************************************/ 
GLUI *glui = GLUI_Master.create_glui( 
"GLUI" ); 
glui->add_checkbox( 
"Wireframe", &wireframe ); 
GLUI_Spinner *segment_spinner =
glui->add_spinner( 
"Segments:", GLUI_SPINNER_INT, &segments ); 
segment_spinner->set_int_limits( 3, 60 );
glui->set_main_gfx_window( main_window );
/* We register the idle callback with GLUI, *not* with GLUT */ 
GLUI_Master.set_glutIdleFunc( myGlutIdle );
glutMainLoop();
}

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
whats the errors then? post them here

Author

Commented:

1>------ Build started: Project: gluiii, Configuration: Debug Win32 ------
1>Linking...
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>glui32.2008.lib(glui.obj) : error LNK2019: unresolved external symbol ___glutCreateWindowWithExit@8 referenced in function _glutCreateWindow_ATEXIT_HACK@4
1>glui32.2008.lib(glui_listbox.obj) : error LNK2019: unresolved external symbol ___glutCreateMenuWithExit@8 referenced in function _glutCreateMenu_ATEXIT_HACK@4
1>C:\Users\hannibal\Documents\Visual Studio 2008\Projects\1_ia_verticalSpring\Debug\gluiii.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\hannibal\Documents\Visual Studio 2008\Projects\gluiii\Debug\BuildLog.htm"
1>gluiii - 3 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Open in new window

you need to link with glut32.lib
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Author

Commented:
I added  glui32.2008.lib  
 
if you mean, click project> properties> linker    Vs.

Can you write each step to link glui32.2008.lib   in VS 2008 ?

 regards.
Ok, thing is, here i only got the german version, but i try to translate ..

project/properties/configuration/linker/input/additional dependencies

make sure to set it for every configuration (debug/release etc..)
Hi loopfinity,

do you still need help?

ike

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial