Linker Error Undefined Reference To Glclear 4
Contents |
here for a quick overview of undefined reference to glclearcolor@16' the site Help Center Detailed answers to any undefined reference to glgetstring questions you might have Meta Discuss the workings and policies of this site About undefined reference to `_imp____glutinitwithexit@12' Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow
Gdi32
Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up GLFW Undefined References up vote glfw cmake 2 down vote favorite I'm trying to use GLFW on a project, but when I compile it, I get a lot of undefined reference errors, while many of them is on the library file (libglfw.a). I tried both, compile the library and download it, but without success. I'm using MinGW and MSYS running on Windows 7 32-bits on netbeans. The GLFW version is 2.7.3; These are the errors: "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: Entering directory `/c/Users/Raphael/Documents/NetBeansProjects/Prism' "/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/prism.exe make[2]: Entering directory `/c/Users/Raphael/Documents/NetBeansProjects/Prism' mkdir -p build/Debug/MinGW-Windows rm -f build/Debug/MinGW-Windows/main.o.d g++.exe -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp mkdir -p dist/Debug/MinGW-Windows g++.exe -o dist/Debug/MinGW-Windows/prism build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/ByteBuffer.o -Lexternal -lglfw build/Debug/MinGW-Windows/main.o: In function `main': C:\Users\Raphael\Documents\NetBeansProjects\Prism/main.cpp:35: undefined reference to `glMatrixMode@4' C:\Users\Raphael\Documents\NetBeansProjects\Prism/main.cpp:36: undefined reference to `glLoadIdentity@0' build/Debug/MinGW-Windows/main.o: In function `Z6render
Cannot Find -lglut32
my compiler said there were linking errors and that the source programme wasn't created. What can I
Opengl Tutorial
do? Last edited on Jun 11, 2010 at 7:31am UTC Jun 11, 2010 at 9:04am UTC spaggy (115) Make sure you've included the required openGL libraries. Jun 11, http://stackoverflow.com/questions/9336263/glfw-undefined-references 2010 at 10:57am UTC Citis (19) I have included them: #include
2
3
4
5
6
7
8
9
10
11
[Linker error] undefined reference to `_imp____glutInitWithExit@12' [Linker error] undefined reference to `_imp____glutCreateWindowWithExit@8' [Linker error] undefined reference to `_imp____glutCreateMenuWithExit@8' [Linker error] undefined reference to `glClear@4' [Linker error] undefined reference to `glFlush@0' [Linker error] undefined reference to `_imp__glutInitWindowSize@8' [Linker error] undefined reference to `_
Page 1 of 1 New Topic/Question Reply 7 Replies - 14750 Views http://www.dreamincode.net/forums/topic/177726-why-isnt-this-opengl-program-not-working-for-me/ - Last Post: 16 June 2010 - 03:10 PM https://www.daniweb.com/programming/software-development/threads/195853/undefined-reference-to-opengl-functions Rate Topic: #1 heyoman1 D.I.C Addict Reputation: 64 Posts: 735 Joined: 30-November 09 Why isnt this OpenGL program not working for me? Posted 14 June 2010 - 04:35 PM when i compile this code #include
simple game using SDL and OpenGL. Up until now, I was using purely SDL and pixel manipulations on the framebuffer to draw lines and other shapes. However, as you would expect, that got unbearably slow as the number of objects on the screen increased. Now I tried to switch to OpenGL. The includes work fine, SDL_GL_SetAttribute works fine, and SDL_SetVideoMode works fine so long as I don't use any purely OpenGL functions. However as soon as I try to use an opengl function (that I copied from a tutorial), my compiler gives me an Undefined Reference error for all the pure OpenGL functions. /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:47: undefined reference to `glViewport' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:48: undefined reference to `glClearColor' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:49: undefined reference to `glClearDepth' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:50: undefined reference to `glDepthFunc' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:51: undefined reference to `glEnable' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:52: undefined reference to `glShadeModel' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:53: undefined reference to `glMatrixMode' /home/usrname/NetBeansProjects/SDLPROJ/main.cpp:54: undefined reference to `glMatrixMode' As you can see, I'm using NetBeans and Ubuntu 9.04. Are there special linker options that I need to add for my program to be dynamically linked to the OpenGL dlls? Any help would be appreciated! c++ ubuntu ubuntu-one class NoClass { public: ~NoClass () { delete this; } }; Zcool31 55 posts since Mar 2009 Community Member 4Contributors 5Replies 16Views 7 YearsDiscussion Span 2 Years Ago Last Post by Константин_2 1 Featured Reply Stinomus 11 7 Years Ago You need to link to the GL library. What you need is to add the -lGL in your linker options. Likewise if you need glut or glu library functions you want -lglut -lglu respectively. The trick is to remember that if you use any functions from included header files that come from other sources you need to link to the library containing the function definition. This excludes the C++ standard library as this is done automatically by your compiler. EDIT: and ensure these libraries exist, likely in /usr/lib 0