0

I have a Problem Setting up OpenGL with Embarcadero's C++-Builder. I managed to successfully compile the Project from here
http://edn.embarcadero.com/article/10528
so I can use functions like glClearColor, or glBegin(), glVertex3f() or glEnd, but I get unresolved external Errors when I try and use glGenBuffers, glBindBuffer, glUseProgramm and so on.

Question: What are the steps to follow to set this up correctly?

I also downloaded Glew from here http://glew.sourceforge.net/. The binary Version does not work, because as usually you can't use .lib files for Visual Studio with Embarcadero.

So I tried to compile the sources with Embarcadero. There is a CMakeLists.txt, but when I type cmake -G "Borland Makefiles" path-to-my-downloaded-sources in the Directory where I want my Borland Makefiles, the error message is

Could NOT find PkgConfig.

The sources I downloaded from http://glew.sourceforge.net/ do only contain 3 .c-files, so I created myself a Static-Library Project with Embarcadero and built it. Now If I add These test lines to my Project

#include <GL\glew.h> 
GLuint buffer;
glGenBuffers(1, &buffer);

and link to that static library, it compiles, but I get a runtime error

Access Violation at adddress ...

Adding the glew32.dll from the bin-Version of GLEW does not help here.

So what should I do? In particular, how do I compile a .dll with Embarcadero, although glew.c from the sources does not contain any __declspec(DLL_EXPORT) Statement?

Steven Carlson
  • 925
  • 1
  • 10
  • 25
mathgenius
  • 165
  • 1
  • 13
  • Does this help: http://stackoverflow.com/questions/3032386/glgenbuffers-not-defined – Phil Williams May 04 '15 at 09:28
  • No it's not yet sufficient, although it helped me to not get a linker error any more, but a runtime error. I edited my questions, so you see what I tried. – mathgenius May 04 '15 at 11:42
  • possible duplicate of [Setting up Opengl for Borlandc++](http://stackoverflow.com/questions/26146116/setting-up-opengl-for-borlandc) – Spektre May 05 '15 at 08:07
  • start with simple GL only http://stackoverflow.com/a/20679773/2521214 and when working then add GLEW ... GLEW must be initialized only After the GL init !!! – Spektre May 05 '15 at 08:18

0 Answers0