User forums > Help

CodeBlocks won't build properly? (OpenGL with c++) [Seems to be Solved]

(1/2) > >>

Areyan:
Hi,

I am running Code::Blocks 02-nov-2012 build with the TDM-GCC 4.7.1 compiler, on win 7.

I'm currently trying to learn myself some OpenGL through this tutorial.
However I'm puzzeled as to how I'm supposed configure the Code::Blocks/the compiler, to correctly build and compile my code since:

The code I have written is the exact same as the one found the one found here,
and I have downloaded all the necessary libraries for the tutorial through the links provided by the site,
and placed all header files at their appropriate locations in the MinGW include folder.
I have even set up appropriate search paths for the compiler in Code::Blocks, so that I'm sure that it finds all the header files.

Now I don't get any build errors or anything like that when I hit F9 to build and run, but the annoying "This project hasn't been built yet..." message pops up, whereupon nothing happens at all when I click the ok-button.
No project is ever built, no code is ever compiled, and there's certainly no code beeing run!

I'm pretty sure that I have done everything right, but still, there might be something important that I might have missed.

So I'm hoping some of you forum geniuses might be able to help me out here.

Thanks in advance  :)

stahta01:
Turn on full Compiler logging.
Do a re-build; NOT a build and run!
Then, read the build log.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Edit: In the future, please verify the links you post work correctly.

Tim S.



Areyan:

--- Quote from: stahta01 ---Edit: In the future, please verify the links you post work correctly.
--- End quote ---

Sorry about the links, they should be fixed now.

However:
I did a reabuild this time, and enabled full compiler logging.
Now my build log has about 50 lines similar to these:

D:\CodeBlocks\MinGW32\lib\libglfw.a(window.o):window.c:(.text+0x896): undefined reference to `_imp__glClear@4'
D:\CodeBlocks\MinGW32\lib\libglfw.a(win32_window.o):win32_window.c:(.text+0x240): undefined reference to `_imp__wglMakeCurrent@8'
D:\CodeBlocks\MinGW32\lib\libglfw.a(win32_window.o):win32_window.c:(.text+0x251): undefined reference to `_imp__wglDeleteContext@4'

Anyone that can hint at what this means?

stahta01:
"undefined reference" means linking error caused by missing libraries or object files.
NOTE: Many compilers require you to put the object files and libraries in the correct order for the linker to work right.

I suggest find another site that helps with programming questions and to post the full build log on that site.
This is NOT a site that helps with programming questions.

EDIT: You DID NOT post the full build log; you posted the build (error) messages.

Tim S.

Areyan:

--- Quote from: stahta01 on November 07, 2012, 10:34:58 pm ---This is NOT a site that helps with programming questions.

EDIT: You DID NOT post the full build log; you posted the build (error) messages.

Tim S.

--- End quote ---

I'm sorry if I have expressed myself such that you may think this is about programming, I'm not looking for programming help.
I'm looking for help on how to set up my compiler so that everything is compiled and linked correctly, using the libraries in the tutorial I have linked to.

Since I'm using Code::Blocks, and I'm fairly new to it, I though this might be a good place to ask, to see if anyone here knew of any Code::Blocks quirks that I need to pay attention to.

And in that regard I also have to ask the newbie question on where to find the build log, if it's not in the Build Log tab at the bottom of Code::Blocks?
And yes, I have turned on full compiler logging.

Finally I'm sorry if this response is a bit blunt, but i have little experience with compiler-settings and like, as I have had little need to do so in the past. As I hope you can imagine, it's a little aggravating to be faced by a very unfamiliar problem and not be able to figure it out yourself.

Navigation

[0] Message Index

[#] Next page

Go to full version