User forums > General (but related to Code::Blocks)

Compiler error where Code had worked before

<< < (3/3)

OldFangle:
Hi

> Follow the rule: the linker is always right. The lib is not there because it's name is opengl32.
Okay, I'm not one to call a linker a liar anyway.  I'd ask why it's there, then, but

> It becomes off-topic for this forum...
I'll look elsewhere.

> Additionally please follow the forum rules! Thank you.
No worries.  Which one(s) did I break?  I wouldn't have if I'd had a hunch I was doing so.

Thank you.
OF

MortenMacFly:

--- Quote from: OldFangle on January 28, 2015, 10:37:53 pm ---> Follow the rule: the linker is always right. The lib is not there because it's name is opengl32.
Okay, I'm not one to call a linker a liar anyway.  I'd ask why it's there, then, but

--- End quote ---
Its there because you setup the project as it is. Check the project's linker options and change opengl to opengl32.

Its recommended that you should understand the basics of compiling/linking before you start with an IDE. This is teached best at the command line reading a book or tutorial, IMHO. Then it is very easy and convenient to transfer these settings to the IDE and leave the command line.

We cannot teach for every SDK out there how to setup C::B for it. Therefore such questions are not allowed here. Are you aware that there are literally millions of SDK's available? So to know what path to setup for the compiler, what options and what libraries to link against is up to the developer (you), not to this forums. By "accident" you found people here that use SFML but that is not guaranteed.

If you have specific (IDE related) questions, like "I know I have to link against opengl32, but where do I set it up best / at all?" after reading the tutorials we provide its OK. In the end: If you want the developers of C::B to continue development on C::B instead of providing general programming support... well.... read and follow the rules. ;-)

BlueHazzard:

--- Quote --- Something I'm having trouble pinning-down is what's necessary to put into the Workspace Build Opts and Globals, if there's only one Project within the Workspace: Is it enough to put the information in the Project's Project/Build Options and Global Settings and leave the corresponding Workspace areas empty?
--- End quote ---
You can not modify buld settings in a workspace (this would be a nice feature). You can set the build settings on a global base (all project apply this settings, so this is basically never usefull expect for global include paths ecc.) on a project base (all targets in this project apply this settings) and on a target base (only this target applies this settins)  for future reading:[1] 



--- Quote ---c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lopengl
--- End quote ---
the linker obviously doesn't find the file "opengl". So there are two reasons possible: he doesn't know the path to "opengl" or you have written it wrong...


--- Quote ---Before bad habits set in perhaps I can get advice on what's listed here: my #defines, Linkers, and Directory Search paths.  Apart from what might be in the wrong place, what should be added, omitted, or re-sorted differently in the lists?
--- End quote ---
this should be obvious... read the wiki link [1]  i posted here, things will get more clear... And more then all learn exactly what a compiler is and the build steps of gcc (wikipedia is your friend)


--- Quote ---> Additionally please follow the forum rules! Thank you.
No worries.  Which one(s) did I break?  I wouldn't have if I'd had a hunch I was doing so.
--- End quote ---
Any question like "what is the right filename for opengl" or "what are the right additional compiler commands for my build" are wrong in this forum, because we give no support for compiler, only for the IDE. So you can ask "where do i set the compiler option XYZ so that it gets used on every target".  But this kind of question should not come up, if you read [1]

greetings

[1] http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks

[Edit:] So MortenMacFly was faster, but i didn't wanted to throw away what i had already written :), so i will post it anyway

OldFangle:
@MortenMacFly

I'm sorry for the trouble.  I've started a chat with someone over at the SFML Forum, I'll take some of this there, then.

> Its recommended that you should understand the basics of compiling/linking before you start with
> an IDE.

This was kind of how I was learning it.  Starting out, it all looked like a big sphere to me, one starting point looked pretty much like any other.

Everything I was trying to learn here was happening inside Code::Blocks and I learned about C::B very recently from YouTube videos which were all showing SFML with it.  In my head it was all connected but I understand you're point.

Thanks very much again, everyone, for your time and patience with these questions.
Shouldn't be too long before I'm back with some actual C::B questions for the group.

Cheers
OF

OldFangle:
@BlueHazzard

Thanks for the link.  I'm not sure I've seen this article before.  As soon as I clearly recognise a problem I go looking for its solution.  This saves me time for sure.

OF

Navigation

[0] Message Index

[*] Previous page

Go to full version