473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

*** [block.exe] Error 1

11
I just got the OpenGL SuperBible and wanted to try to compile an example file. At first I got a big list of errors. I added -lopengl32 -lglut32 into Project Options -> Parameters -> Linker. Then all it said was *** [block.exe] Error 1 (bock.exe is my program) I am using Dev C++ 4.9.9.2. Here is the program I am trying to compile.
Expand|Select|Wrap|Line Numbers
  1.   // Block.cpp
  2. // OpenGL SuperBible, Chapter 1
  3. // Demonstrates an assortment of basic 3D concepts
  4. // Program by Richard S. Wright Jr.
  5.  
  6. #include "../shared/gltools.h"    // OpenGL toolkit
  7. #include "../shared/math3d.h"
  8. #include <math.h>
  9.  
  10. // Keep track of effects step
  11. int nStep = 0;
  12.  
  13.  
  14. // Lighting data
  15. GLfloat lightAmbient[] = { 0.2f, 0.2f, 0.2f, 1.0f };
  16. GLfloat lightDiffuse[] = { 0.7f, 0.7f, 0.7f, 1.0f };
  17. GLfloat lightSpecular[] = { 0.9f, 0.9f, 0.9f };
  18. GLfloat materialColor[] = { 0.8f, 0.0f, 0.0f };
  19. GLfloat vLightPos[] = { -80.0f, 120.0f, 100.0f, 0.0f };
  20. GLfloat ground[3][3] = { { 0.0f, -25.0f, 0.0f },
  21.                         { 10.0f, -25.0f, 0.0f },
  22.                         { 10.0f, -25.0f, -10.0f } };
  23.  
  24. GLuint textures[4];
  25.  
  26.  
  27.  
  28.  
  29.  
  30. // Called to draw scene
  31. void RenderScene(void)
  32.     {
  33.     M3DMatrix44f mCubeTransform;
  34.     M3DVector4f pPlane;
  35.  
  36.  
  37.     // Clear the window with current clearing color
  38.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  39.     glShadeModel(GL_SMOOTH);
  40.     glEnable(GL_NORMALIZE);
  41.  
  42.     glPushMatrix();
  43.  
  44.     // Draw plane that the cube rests on
  45.     glDisable(GL_LIGHTING);
  46.     if(nStep == 5)
  47.         {
  48.         glColor3ub(255,255,255);
  49.         glEnable(GL_TEXTURE_2D);
  50.         glBindTexture(GL_TEXTURE_2D, textures[0]);
  51.         glBegin(GL_QUADS);
  52.             glTexCoord2f(0.0f, 0.0f);
  53.             glVertex3f(-100.0f, -25.3f, -100.0f);
  54.             glTexCoord2f(0.0f, 1.0f);
  55.             glVertex3f(-100.0f, -25.3f, 100.0f);        
  56.             glTexCoord2f(1.0f, 1.0f);
  57.             glVertex3f(100.0f,  -25.3f, 100.0f);
  58.             glTexCoord2f(1.0f, 0.0f);
  59.             glVertex3f(100.0f,  -25.3f, -100.0f);
  60.         glEnd();
  61.         }
  62.     else
  63.         {
  64.         glColor3f(0.0f, 0.0f, 0.90f); // Blue
  65.         glBegin(GL_QUADS);
  66.             glVertex3f(-100.0f, -25.3f, -100.0f);
  67.             glVertex3f(-100.0f, -25.3f, 100.0f);        
  68.             glVertex3f(100.0f,  -25.3f, 100.0f);
  69.             glVertex3f(100.0f,  -25.3f, -100.0f);
  70.         glEnd();
  71.         }
  72.  
  73.  
  74.     // Set drawing color to Red
  75.     glColor3f(1.0f, 0.0f, 0.0f);
  76.  
  77.     // Enable, disable lighting
  78.     if(nStep > 2)
  79.         {
  80.         glEnable(GL_DEPTH_TEST);
  81.         glDepthFunc(GL_LEQUAL);
  82.         glEnable(GL_COLOR_MATERIAL);
  83.  
  84.         glLightfv(GL_LIGHT0, GL_AMBIENT, lightAmbient);
  85.         glLightfv(GL_LIGHT0, GL_DIFFUSE, lightDiffuse);
  86.         glLightfv(GL_LIGHT0, GL_SPECULAR, lightSpecular);
  87.         glEnable(GL_LIGHTING);
  88.         glEnable(GL_LIGHT0);
  89.         glMaterialfv(GL_FRONT, GL_SPECULAR,lightSpecular);
  90.         glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, materialColor);
  91.         glMateriali(GL_FRONT, GL_SHININESS,128);
  92.         }
  93.  
  94.     // Move the cube slightly forward and to the left
  95.     glTranslatef(-10.0f, 0.0f, 10.0f);
  96.  
  97.     switch(nStep)
  98.         {
  99.         // Just draw the wire framed cube
  100.         case 0:
  101.             glutWireCube(50.0f);
  102.             break;
  103.  
  104.         // Same wire cube with hidden line removal simulated
  105.         case 1:
  106.             // Front Face (before rotation)
  107.             glBegin(GL_LINES);
  108.                 glVertex3f(25.0f,25.0f,25.0f);
  109.                 glVertex3f(25.0f,-25.0f,25.0f);
  110.  
  111.                 glVertex3f(25.0f,-25.0f,25.0f);
  112.                 glVertex3f(-25.0f,-25.0f,25.0f);
  113.  
  114.                 glVertex3f(-25.0f,-25.0f,25.0f);
  115.                 glVertex3f(-25.0f,25.0f,25.0f);
  116.  
  117.                 glVertex3f(-25.0f,25.0f,25.0f);
  118.                 glVertex3f(25.0f,25.0f,25.0f);
  119.             glEnd();
  120.  
  121.             // Top of cube
  122.             glBegin(GL_LINES);
  123.                 // Front Face
  124.                 glVertex3f(25.0f,25.0f,25.0f);
  125.                 glVertex3f(25.0f,25.0f,-25.0f);
  126.  
  127.                 glVertex3f(25.0f,25.0f,-25.0f);
  128.                 glVertex3f(-25.0f,25.0f,-25.0f);
  129.  
  130.                 glVertex3f(-25.0f,25.0f,-25.0f);
  131.                 glVertex3f(-25.0f,25.0f,25.0f);
  132.  
  133.                 glVertex3f(-25.0f,25.0f,25.0f);
  134.                 glVertex3f(25.0f,25.0f,25.0f);
  135.             glEnd();
  136.  
  137.             // Last two segments for effect
  138.             glBegin(GL_LINES);
  139.                 glVertex3f(25.0f,25.0f,-25.0f);
  140.                 glVertex3f(25.0f,-25.0f,-25.0f);
  141.  
  142.                 glVertex3f(25.0f,-25.0f,-25.0f);
  143.                 glVertex3f(25.0f,-25.0f,25.0f);
  144.             glEnd();
  145.  
  146.             break;
  147.  
  148.         // Uniform colored surface, looks 2D and goofey
  149.         case 2:
  150.             glutSolidCube(50.0f);
  151.             break;
  152.  
  153.         case 3:
  154.             glutSolidCube(50.0f);
  155.             break;
  156.  
  157.         // Draw a shadow with some lighting
  158.         case 4:
  159.             glGetFloatv(GL_MODELVIEW_MATRIX, mCubeTransform);
  160.             glutSolidCube(50.0f);
  161.             glPopMatrix();
  162.  
  163.             // Disable lighting, we'll just draw the shadow as black
  164.             glDisable(GL_LIGHTING);
  165.  
  166.             glPushMatrix();
  167.  
  168.             m3dGetPlaneEquation(pPlane, ground[0], ground[1], ground[2]);
  169.             m3dMakePlanarShadowMatrix(mCubeTransform, pPlane, vLightPos);
  170.             //MakeShadowMatrix(ground, lightpos, cubeXform);
  171.             glMultMatrixf(mCubeTransform);
  172.  
  173.             glTranslatef(-10.0f, 0.0f, 10.0f);            
  174.  
  175.             // Set drawing color to Black
  176.             glColor3f(0.0f, 0.0f, 0.0f);
  177.  
  178.             glutSolidCube(50.0f);
  179.             break;
  180.  
  181.         case 5:
  182.             glColor3ub(255,255,255);
  183.             glGetFloatv(GL_MODELVIEW_MATRIX, mCubeTransform);
  184.  
  185.             // Front Face (before rotation)
  186.             glBindTexture(GL_TEXTURE_2D, textures[1]);
  187.             glBegin(GL_QUADS);
  188.                 glTexCoord2f(1.0f, 1.0f);
  189.                 glVertex3f(25.0f,25.0f,25.0f);
  190.                 glTexCoord2f(1.0f, 0.0f);
  191.                 glVertex3f(25.0f,-25.0f,25.0f);
  192.                 glTexCoord2f(0.0f, 0.0f);
  193.                 glVertex3f(-25.0f,-25.0f,25.0f);
  194.                 glTexCoord2f(0.0f, 1.0f);
  195.                 glVertex3f(-25.0f,25.0f,25.0f);
  196.             glEnd();
  197.  
  198.             // Top of cube
  199.             glBindTexture(GL_TEXTURE_2D, textures[2]);
  200.             glBegin(GL_QUADS);
  201.                 // Front Face
  202.                 glTexCoord2f(0.0f, 0.0f);
  203.                 glVertex3f(25.0f,25.0f,25.0f);
  204.                 glTexCoord2f(1.0f, 0.0f);
  205.                 glVertex3f(25.0f,25.0f,-25.0f);
  206.                 glTexCoord2f(1.0f, 1.0f);
  207.                 glVertex3f(-25.0f,25.0f,-25.0f);
  208.                 glTexCoord2f(0.0f, 1.0f);
  209.                 glVertex3f(-25.0f,25.0f,25.0f);
  210.             glEnd();
  211.  
  212.             // Last two segments for effect
  213.             glBindTexture(GL_TEXTURE_2D, textures[3]);
  214.             glBegin(GL_QUADS);
  215.                 glTexCoord2f(1.0f, 1.0f);
  216.                 glVertex3f(25.0f,25.0f,-25.0f);
  217.                 glTexCoord2f(1.0f, 0.0f);
  218.                 glVertex3f(25.0f,-25.0f,-25.0f);
  219.                 glTexCoord2f(0.0f, 0.0f);
  220.                 glVertex3f(25.0f,-25.0f,25.0f);
  221.                 glTexCoord2f(0.0f, 1.0f);
  222.                 glVertex3f(25.0f,25.0f,25.0f);
  223.             glEnd();
  224.  
  225.  
  226.             glPopMatrix();
  227.  
  228.             // Disable lighting, we'll just draw the shadow as black
  229.             glDisable(GL_LIGHTING);
  230.             glDisable(GL_TEXTURE_2D);
  231.  
  232.             glPushMatrix();
  233.  
  234.             m3dGetPlaneEquation(pPlane, ground[0], ground[1], ground[2]);
  235.             m3dMakePlanarShadowMatrix(mCubeTransform, pPlane, vLightPos);
  236.             glMultMatrixf(mCubeTransform);            
  237.  
  238.             glTranslatef(-10.0f, 0.0f, 10.0f);            
  239.  
  240.             // Set drawing color to Black
  241.             glColor3f(0.0f, 0.0f, 0.0f);
  242.             glutSolidCube(50.0f);
  243.             break;
  244.  
  245.         }
  246.  
  247.     glPopMatrix();
  248.  
  249.     // Flush drawing commands
  250.     glutSwapBuffers();
  251.     }
  252.  
  253. // This function does any needed initialization on the rendering
  254. // context. 
  255. void SetupRC()
  256.     {
  257.         GLbyte *pBytes;
  258.         GLint nWidth, nHeight, nComponents;
  259.         GLenum format;
  260.  
  261.     // Black background
  262.     glClearColor(0.0f, 0.0f, 0.0f, 1.0f );
  263.  
  264.         glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE, GL_MODULATE);
  265.         glGenTextures(4, textures);
  266.  
  267.     // Load the texture objects
  268.         pBytes = gltLoadTGA("floor.tga", &nWidth, &nHeight, &nComponents, &format);
  269.         glBindTexture(GL_TEXTURE_2D, textures[0]);
  270.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  271.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  272.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  273.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  274.     glTexImage2D(GL_TEXTURE_2D,0,nComponents,nWidth, nHeight, 0,
  275.         format, GL_UNSIGNED_BYTE, pBytes);
  276.     free(pBytes);
  277.  
  278.     pBytes = gltLoadTGA("Block4.tga", &nWidth, &nHeight, &nComponents, &format);
  279.         glBindTexture(GL_TEXTURE_2D, textures[1]);
  280.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  281.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  282.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  283.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  284.     glTexImage2D(GL_TEXTURE_2D,0,nComponents,nWidth, nHeight, 0,
  285.         format, GL_UNSIGNED_BYTE, pBytes);
  286.     free(pBytes);
  287.  
  288.     pBytes = gltLoadTGA("block5.tga", &nWidth, &nHeight, &nComponents, &format);
  289.         glBindTexture(GL_TEXTURE_2D, textures[2]);
  290.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  291.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  292.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  293.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  294.     glTexImage2D(GL_TEXTURE_2D,0,nComponents,nWidth, nHeight, 0,
  295.         format, GL_UNSIGNED_BYTE, pBytes);
  296.     free(pBytes);
  297.  
  298.     pBytes = gltLoadTGA("block6.tga", &nWidth, &nHeight, &nComponents, &format);
  299.         glBindTexture(GL_TEXTURE_2D, textures[3]);
  300.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  301.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  302.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  303.     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  304.     glTexImage2D(GL_TEXTURE_2D,0,nComponents,nWidth, nHeight, 0,
  305.         format, GL_UNSIGNED_BYTE, pBytes);
  306.     free(pBytes);
  307.         }
  308.  
  309. void KeyPressFunc(unsigned char key, int x, int y)
  310.     {
  311.     if(key == 32)
  312.         {
  313.         nStep++;
  314.  
  315.         if(nStep > 5)
  316.             nStep = 0;
  317.         }
  318.  
  319.     // Refresh the Window
  320.     glutPostRedisplay();
  321.     }
  322.  
  323.  
  324. void ChangeSize(int w, int h)
  325.     {
  326.     // Calculate new clipping volume
  327.     GLfloat windowWidth;
  328.     GLfloat windowHeight;
  329.  
  330.     // Prevent a divide by zero, when window is too short
  331.     // (you cant make a window of zero width).
  332.     if(h == 0)
  333.         h = 1;
  334.  
  335.     // Keep the square square
  336.     if (w <= h) 
  337.         {
  338.         windowHeight = 100.0f*(GLfloat)h/(GLfloat)w;
  339.         windowWidth = 100.0f;
  340.         }
  341.     else 
  342.         {
  343.         windowWidth = 100.0f*(GLfloat)w/(GLfloat)h;
  344.         windowHeight = 100.0f;
  345.         }
  346.  
  347.         // Set the viewport to be the entire window
  348.         glViewport(0, 0, w, h);
  349.  
  350.         glMatrixMode(GL_PROJECTION);
  351.         glLoadIdentity();
  352.  
  353.     // Set the clipping volume
  354.     glOrtho(-100.0f, windowWidth, -100.0f, windowHeight, -200.0f, 200.0f);
  355.  
  356.         glMatrixMode(GL_MODELVIEW);
  357.         glLoadIdentity();
  358.  
  359.     glLightfv(GL_LIGHT0,GL_POSITION, vLightPos);
  360.  
  361.     glRotatef(30.0f, 1.0f, 0.0f, 0.0f);
  362.     glRotatef(330.0f, 0.0f, 1.0f, 0.0f);
  363.     }
  364.  
  365. int main(int argc, char* argv[])
  366.     {
  367.     glutInit(&argc, argv);
  368.     glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
  369.     glutInitWindowSize(800, 600);
  370.     glutCreateWindow("3D Effects Demo");
  371.     glutReshapeFunc(ChangeSize);
  372.     glutKeyboardFunc(KeyPressFunc);
  373.     glutDisplayFunc(RenderScene);
  374.  
  375.     SetupRC();
  376.  
  377.     glutMainLoop();
  378.     glDeleteTextures(4,textures);
  379.     return 0;
  380.     }
  381.  
Oct 28 '08 #1
9 4049
arnaudk
424 256MB
Did you do a "rebuild all"? Incidentally, I think you'd be better off using the free VC++2008 Express if you're working in windows, DevC++ is no longer updated as of 2005. Some people also like CodeBlocks.
Oct 28 '08 #2
flyvin
11
I downloaded code blocks(I like open source) and its awesome! Unfortunately, I still have an error. I think I have trouble including gltools.h. Has anyone used this book?
Nov 2 '08 #3
flyvin
11
Also, its different errors now. It says it cant find some functions, and there in gltools.h
Nov 3 '08 #4
arnaudk
424 256MB
If it can not find functions which are declared in gltools.h at linktime, then you probably haven't linked the correct libraries or the linker can't find then (adjust your paths). Can you can show us the error messages?
Nov 3 '08 #5
flyvin
11
Here are my errors. I'm pretty new, and I'm not quite sure how to link a library.
Expand|Select|Wrap|Line Numbers
  1. obj\Debug\Block.o(.text+0x3da)||In function `Z11RenderScenev':|
  2. F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|102|undefined reference to `glutWireCube'|
  3. obj\Debug\Block.o(.text+0x6d6):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|151|undefined reference to `glutSolidCube'|
  4. obj\Debug\Block.o(.text+0x6e9):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|155|undefined reference to `glutSolidCube'|
  5. obj\Debug\Block.o(.text+0x712):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|161|undefined reference to `glutSolidCube'|
  6. obj\Debug\Block.o(.text+0x74e):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|169|undefined reference to `m3dGetPlaneEquation(float*, float const*, float const*, float const*)'|
  7. obj\Debug\Block.o(.text+0x768):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|170|undefined reference to `m3dMakePlanarShadowMatrix(float*, float const*, float const*)'|
  8. obj\Debug\Block.o(.text+0x7c8):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|179|undefined reference to `glutSolidCube'|
  9. obj\Debug\Block.o(.text+0xb95):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|235|undefined reference to `m3dGetPlaneEquation(float*, float const*, float const*, float const*)'|
  10. obj\Debug\Block.o(.text+0xbaf):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|236|undefined reference to `m3dMakePlanarShadowMatrix(float*, float const*, float const*)'|
  11. obj\Debug\Block.o(.text+0xc0f):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|243|undefined reference to `glutSolidCube'|
  12. obj\Debug\Block.o(.text+0xc19):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|251|undefined reference to `glutSwapBuffers'|
  13. obj\Debug\Block.o(.text+0xcab)||In function `Z7SetupRCv':|
  14. F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|269|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
  15. obj\Debug\Block.o(.text+0xdb4):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|279|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
  16. obj\Debug\Block.o(.text+0xebd):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|289|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
  17. obj\Debug\Block.o(.text+0xfc6):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|299|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
  18. obj\Debug\Block.o(.text+0x10da)||In function `Z12KeyPressFunchii':|
  19. F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|321|undefined reference to `glutPostRedisplay'|
  20. obj\Debug\Block.o(.text+0x126c)||In function `main':|
  21. F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|368|undefined reference to `glutInit'|
  22. obj\Debug\Block.o(.text+0x1278):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|369|undefined reference to `glutInitDisplayMode'|
  23. obj\Debug\Block.o(.text+0x128c):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|370|undefined reference to `glutInitWindowSize'|
  24. obj\Debug\Block.o(.text+0x1298):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|371|undefined reference to `glutCreateWindow'|
  25. obj\Debug\Block.o(.text+0x12a4):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|372|undefined reference to `glutReshapeFunc'|
  26. obj\Debug\Block.o(.text+0x12b0):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|373|undefined reference to `glutKeyboardFunc'|
  27. obj\Debug\Block.o(.text+0x12bc):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|374|undefined reference to `glutDisplayFunc'|
  28. obj\Debug\Block.o(.text+0x12c6):F:\Documents and Settings\Sam\Desktop\C++ programing\OpenGL\test1\Block.cpp|378|undefined reference to `glutMainLoop'|
  29. ||=== Build finished: 24 errors, 0 warnings ===|
  30.  
Nov 4 '08 #6
flyvin
11
I found a library file, but I still cant figure out how to link it.
Nov 9 '08 #7
arnaudk
424 256MB
The way you link libraries depends on your compiler and IDE. For g++, for example, you can link the libraries opengl32 and glut32 using the command line switches -lopengl32 -lglut32. You need to figure out how to link those relevant libraries in your IDE, have a look through your compiler/IDE reference manual.
Nov 9 '08 #8
flyvin
11
I have glut and opengl fine, but theres a file called freeglut_static.lib and I think I need it. If its not that, then a I have no idea what to do.
Nov 9 '08 #9
arnaudk
424 256MB
I'm not familiar with the OpenGL Superbible, but if you think you need to link freeglut_static.lib, you can do this in g++ with -lfreeglut_static. You might need to tell the compiler where to look for freeglut_static.lib, and you can do this in g++ using the -L switch (see g++ manual online). Have a careful look through the notes that came with your book about compiling the examples, one would think it would not have been taken for granted that you should know how to do this knowing nothing about the libraries that it comes with.
Nov 10 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Páll Ólafsson | last post by:
Hi I have a problem with the Microsoft.ApplicationBlocks.ExceptionManagement? I can't get it to work in RELEASE mode? If I run the project in debug mode the block works fine but when I run the...
0
by: AMDRIT | last post by:
Hello everyone, I am attempting to use the Application Updater Block for my application. I am running into an issue, once the appstart.exe has pulled down an update, it will not do so again...
0
by: gl | last post by:
I'm currently using the old appudater util from asp.net, however this is very similar to the updater application block offered by microsoft. Basically, I set up a folder structure using a setup and...
1
by: Robert N | last post by:
I was able to compile (Debug) and reference an Configuration Block project for my primary application "AppPrimary.exe". When I add a strong name file to the Configuration Block project and...
0
by: George Durzi | last post by:
I'm trying to extend the ExceptionManager Application Block and build a custom publisher that writes my exceptions to the database. That's easy part. The difficulty I am having is in configuring my...
2
by: CodeSlayer | last post by:
Hi all, This one really has me and the other .Net developers at my work stumped. I have an application that is doing the following: 1 - attempt to validate that user can create a windows task...
9
by: meerubus | last post by:
Hi, Could someone advise how to go about writing a (simple?) C++ program to block a windows exe file from running? For example, my child likes to run halo.exe & the pgm can run even in a...
3
by: Mukesh | last post by:
Hi all As per my earlier conversation with Ciaran (thx for reply) I have installed the MS APplication block on the server , when i ran Build Enterprise Library file and Install Services from...
1
by: arunairs | last post by:
Hi, Using the EnterpriseLibrary 4.0, is it possible to Log the method name in the log file. I have it cofigured thus: <loggingConfiguration name="Logging Application Block"...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.