2 Replies - 617 Views - Last Post: 10 August 2015 - 06:32 AM Rate Topic: -----

#1 Hengad   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 01-October 14

Need help with setupping OpenGL for CodeBlocks

Posted 06 August 2015 - 01:28 PM

First of all; I know there are hundreds of threads like this, but those I have viewed haven't helped me. All tutorials I have watched or read about setting up OpenGL are different. And none of them have helped.

So. What I have done so far (ignore sfml things, they are working fine);
I have freeglut and glew includes in compiler tab.

Posted Image

And freeglut & glew libs in linker tab.

Posted Image

In compiler settings -> #defines, I have GLEW_BUILD typed there.

When I run my program, it gives me errors "undefined reference to '(some function here)'". I guess problem is that I don't have anything in linker settings. But if it's because of that, I don't know what I should write in there. Any help would be appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Need help with setupping OpenGL for CodeBlocks

#2 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 890
  • View blog
  • Posts: 3,592
  • Joined: 13-June 14

Re: Need help with setupping OpenGL for CodeBlocks

Posted 08 August 2015 - 11:02 AM

There are basically two things that need to happen when you're using an external library

1. You need to tell the compiler (well, technically, the linker) to use the library
2. You need to tell the linker where to find the library

It looks like you've done only the latter. With gcc, you tell the compiler to link a library with the -l option on the command line. We use -l followed by the library name - for example, for some fictional library libfoo, at least on *NIX systems we'd pass -lfoo.

I don't use Windows and don't have CodeBlocks, but I suspect the equivalent of this is what needs to go in the linker settings section (though you'd do that on a per-project basis, because you won't always want to link those libraries).
Was This Post Helpful? 0
  • +
  • -

#3 Hengad   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 01-October 14

Re: Need help with setupping OpenGL for CodeBlocks

Posted 10 August 2015 - 06:32 AM

Well I linked libraries and it doesn't give me linking errors, but now it gives me error when running; "The application was unable to start correctly (0xc000007b)". I guess last time when I tried to get OpenGL work, I got stuck to this same error and didn't get it work so I gave up. I don't want to give up now, do someone know what to do?

This post has been edited by Skydiver: 10 August 2015 - 01:49 PM
Reason for edit:: Removed unnecessary quote. No need to quote the post above yours.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1