User forums > Using Code::Blocks

Set up GLEW in CODE::BLOCKS

<< < (4/6) > >>

MortenMacFly:
You'll need to fix the compiler and linker errors - these are no errors due to a wrong setup of the compiler.

Usually you are missing to setup the include path's for the compiler to find required header files and for the linker to find required libraries. Finally you'll need to link against the right libraries in the right order.

All these settings depend on what you have in mind and what framework you use, so I cannot help any more. We can't provide framework-related support in this forum, sorry. Read the documentation / developer guide of GLEW and setup you project/target options accordingly (notice: NOT the global compiler options!).

searcher:
@MortenMacFly:
I appreciate your reply, however, it appears to me that there is something very odd going on - most likely nothing to do with GLEW. In desperation I wiped out all previous projects and decided to make a totally fresh start. Downloaded fresh installation of CODE::BLOCKS and decided to run the "Hello World" example which comes with it.
(1) Program compiles perfectly.
(2) Hit Build&Run and get a mass of errors similar to those I started this post with.
I have built and run many, more complex, C++ programs with CB in the past and I'm completely stumped.

MortenMacFly:

--- Quote from: searcher on August 30, 2012, 02:17:24 am ---(1) Program compiles perfectly.
(2) Hit Build&Run and get a mass of errors similar to those I started this post with.

--- End quote ---
I don't get it: Does it compile or not? The first bullet says yes, the second one says no.

Things like this:
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\crt2.o:crt1.c|| undefined reference to `SetUnhandledExceptionFilter@4'|

...are linker errors and you need to fix them. In this specific case you are missing to link against kernel32. For details, see here:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680634%28v=vs.85%29.aspx and use google.

As I've said: Read the frameworks developer guide what dependencies you have. If in doubt, compile a simple example on the command line - then transfer the settings into the IDE. Most people in this forum don't know GLEW and this question is not related to Code::Blocks. So you won't find much helpful advise here - ask in a GLEW forum for the library dependencies.

searcher:
@MortenMacFly:
F.Y.I. on the BUILD dropdown there is an option "compile current file" which results in compilation without building or running !! Hence my bullet (1). Bullet (2) followed from using Build option AFTER the first option. I think you will find that explains my post.
I must also disagree that this is not related to Code::Blocks. However, it is clear that the problem relates to linking (that's what the Build instruction does) as you observe. I shall certainly consult the reference you supplied and thank you for your patience.

Jenna:

--- Quote from: searcher on August 30, 2012, 07:30:22 pm ---I must also disagree that this is not related to Code::Blocks. However, it is clear that the problem relates to linking ...

--- End quote ---
Why do you think it's related to Code::Blocks ?
C::B only does what you tell it to do, it uses the linking options you set up and links your files with the executable you have specified.

C::B is neither a linker, nor a compiler, it does not do any hidden magic, it's "just" an IDE, that generates the needed commands from your setup.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version