Author Topic: Simple OpengGL project port from VS to CB  (Read 2695 times)

Offline jdn_Jonny

  • Single posting newcomer
  • *
  • Posts: 2
Simple OpengGL project port from VS to CB
« on: December 11, 2015, 06:40:27 am »
Hey guys,

I have been working with GLFW and GLEW in Visual Studio, no problem. Now I downloaded codeblocks, and would like to port my code over to code blocks before it gets so big I won't feel like doing it.

I tested the basic OpenGL demo (triangle) which runs without any issues. But when I create an empty project myself, add GLEWand GLFWto it, and compile it, it gives me a bunch of unresolved externals, such as:

'undefined reference to _imp__glewInit@0'
C:\Dev Tools\Middleware\GLFW\lib\Debug\glfw3.lib(glfw.dir\Debug\window.obj):(.text$mn+0xc7)||undefined reference to `_RTC_CheckEsp'|

I'm using the exact same header files & lib files I used in Visual Studio, where they worked. All I did there, was include the headers, and the libs in the project, add GLEW_STATIC and that's it...

So anyway, under linker, I have added the lib files, under compiler i have added the include files. In fact, I know codeblocks finds them, if it didn't it'd say something like "can't find glew32s.lib" or whatever. I also declared GLEW static...

I'm using the built in GNU GCC compiler. GCC, G++ v5.2.0

Win 7

Please help guys, what am I missing? I've just started with code blocks, but it can't be that hard if there's an OpenGL project already coming with codeblocks.

I have tried setting up a GLFW project too, but it keeps saying that the header file is not found, since it's looking for glfw.h instead of glfw3.h...

Thank you ever so much in advance

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Simple OpengGL project port from VS to CB
« Reply #1 on: December 11, 2015, 06:54:16 am »
Do you use libs compiled for/with VS with gcc ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7607
    • My Best Post
Re: Simple OpengGL project port from VS to CB
« Reply #2 on: December 11, 2015, 07:07:01 am »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jdn_Jonny

  • Single posting newcomer
  • *
  • Posts: 2
Re: Simple OpengGL project port from VS to CB
« Reply #3 on: December 11, 2015, 07:16:00 am »
jens - I compiled GLFW myself with VS, indeed. GLEW was a downloaded binary. So I'm going to go ahead and assume that it was probably built with VS as well, that why it worked? I tried vcompiling GLEW meself but the source seemed like it was all over the place, VS didn't find the majority of the files and dependencies so I gave up and just went with a precompiled version, which worked...

Btw I'm more than happy to share files if anyone cares to look into it?

stahta01 -  "I also declared GLEW static..." so yeah, I did :p
« Last Edit: December 11, 2015, 07:18:13 am by jdn_Jonny »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7607
    • My Best Post
Re: Simple OpengGL project port from VS to CB
« Reply #4 on: December 13, 2015, 05:40:56 pm »
If you still want help post the full rebuild log; if no log is posted I for one will ignore this thread.

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

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org