User forums > Using Code::Blocks
Set up GLEW in CODE::BLOCKS
searcher:
@obfuscated
Thankyou for trying to be helpful. I had already seen these sites.One of them refers to static linking which I do not want for the quoted example, the other didn't work for me but I may try it again to see if I can make it work.
Thankyou anyway.
searcher:
@stefanos.
First of all You are the one who needs to be reprimanded. Your "reply" started by calling me a liar - if that is your idea of politeness you need some lessons in manners.
None of the sources you quote (all of which I have previously examined) is relevant to my request.
oBFusCATed:
searcher:
What is the problem with this solution http://stackoverflow.com/a/6932318 ?
And what is the problem with using the dlls directly? As far as I know newer mingw/tdm gcc support directly linking to the dll.
I'm using glew, but I don't remember what I did to make it build.
thomas:
Getting GLEW to work (it's admittedly some time since I've last used it, but either way) is really a matter of reading the 20 or so lines of installation howto on the GLEW website. It boils down to having GLEW_STATIC set or not set, depending on what you want. If you don't want to link dynamically (though it's silly to insist on that if you already have a DLL and just want to get a book example running...), you'll have to set that variable.
That done, it's max 1-2 mins to have a running program.
I don't see how it's much related to Code::Blocks, however.
searcher:
Update to my request: I used msys on the source file glew-1.9.0 and obtained the following-
glew32.dll, libglew32.a and libglew32.dll.a. I put glew32.dll in C:\windows\sysWOW64.
The other two went into ....\MinGW\lib
The headers are in the correct location. Then in the project I have linker options:glew32,freeglut,opengl32,glu32,winmm,gdi32 in that order.
Problem ch1.1 from openGLBook works fine so freeglut is O.K. Problem ch1.2 which adds glew give the following list of errors.||=== chapter1.2, Debug ===|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\crt2.o:crt1.c|| undefined reference to `SetUnhandledExceptionFilter@4'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\crt2.o:crt1.c|| undefined reference to `ExitProcess@4'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\crtbegin.o:cygming-crtbegin.c|| undefined reference to `GetModuleHandleA@4'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\crtbegin.o:cygming-crtbegin.c|| undefined reference to `GetProcAddress@8'|
obj\Debug\main.o||In function `glutInit_ATEXIT_HACK':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\GL\freeglut_std.h|612|undefined reference to `_imp____glutInitWithExit@12'|
obj\Debug\main.o||In function `glutCreateWindow_ATEXIT_HACK':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\GL\freeglut_std.h|614|undefined reference to `_imp____glutCreateWindowWithExit@8'|
obj\Debug\main.o||In function `glutCreateMenu_ATEXIT_HACK':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\GL\freeglut_std.h|616|undefined reference to `_imp____glutCreateMenuWithExit@8'|
obj\Debug\main.o||In function `main':|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|43|undefined reference to `_imp__glutMainLoop@0'|
obj\Debug\main.o||In function `Z10InitializeiPPc':|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|69|undefined reference to `glGetString@4'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|71|undefined reference to `glClearColor@16'|
obj\Debug\main.o||In function `Z10InitWindowiPPc':|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|78|undefined reference to `_imp__glutInitContextVersion@8'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|79|undefined reference to `_imp__glutInitContextFlags@4'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|80|undefined reference to `_imp__glutInitContextProfile@4'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|85|undefined reference to `_imp__glutSetOption@8'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|87|undefined reference to `_imp__glutInitWindowSize@8'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|89|undefined reference to `_imp__glutInitDisplayMode@4'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|101|undefined reference to `_imp__glutReshapeFunc@4'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|102|undefined reference to `_imp__glutDisplayFunc@4'|
obj\Debug\main.o||In function `Z14ResizeFunctionii':|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|109|undefined reference to `glViewport@16'|
obj\Debug\main.o||In function `Z14RenderFunctionv':|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|114|undefined reference to `glClear@4'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|116|undefined reference to `_imp__glutSwapBuffers@0'|
C:\Users\DrMike\Graphics\chapter1.2\main.cpp|117|undefined reference to `_imp__glutPostRedisplay@0'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libmingw32.a(pseudo-reloc.o):pseudo-reloc.c|| undefined reference to `VirtualQuery@12'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libmingw32.a(pseudo-reloc.o):pseudo-reloc.c|| undefined reference to `VirtualProtect@16'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libmingw32.a(pseudo-reloc.o):pseudo-reloc.c|| undefined reference to `VirtualProtect@16'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\libgcc.a(cygming-shared-data.o)||In function `cmshared_get_ptr_from_atom':|
c:\crossdev\b4.4.1-tdm-1\build-sjlj\mingw32\libgcc\..\..\..\..\gcc-4.4.1\libgcc\..\gcc\config\i386\cygming-shared-data.c|91|undefined reference to `GetAtomNameA@12'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\libgcc.a(cygming-shared-data.o)||In function `_cmshared_create_or_grab':|
c:\crossdev\b4.4.1-tdm-1\build-sjlj\mingw32\libgcc\..\..\..\..\gcc-4.4.1\libgcc\..\gcc\config\i386\cygming-shared-data.c|140|undefined reference to `FindAtomA@4'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\libgcc.a(cygming-shared-data.o)||In function `cmshared_add_ptr_as_atom':|
c:\crossdev\b4.4.1-tdm-1\build-sjlj\mingw32\libgcc\..\..\..\..\gcc-4.4.1\libgcc\..\gcc\config\i386\cygming-shared-data.c|118|undefined reference to `AddAtomA@4'|
||=== Build finished: 28 errors, 0 warnings ===| HELP!!!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version