problem with glXGetProcAddress on linux

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

problem with glXGetProcAddress on linux

Post by Iaro »

Hello,

I tried to compile the default Irrlicht project from Code::Blocks but got the " undefined reference to `glXGetProcAddress' " error. After searching the forum I modified COpenGLDriver.cpp as described in http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=66461.

In the cpp file I replaced :

Code: Select all

#ifdef GLX_VERSION_1_4
	#define IRR_OGL_LOAD_EXTENSION glXGetProcAddress
	#else
	#define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB
#endif
with :

Code: Select all

#ifndef GLX_ARB_get_proc_address
  	#define IRR_OGL_LOAD_EXTENSION glXGetProcAddress
  	#else
 	 #define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB
	#endif 

After typing make in the terminal i got the following error :
"COpenGLDriver.cpp:422: error: ‘glXGetProcAddressARB’ was not declared in this scope"

This is line 422 : IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glActiveTextureARB"));

Could someone please help me?

Thanks in advance,
Robert
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

the answer you're looking for is here:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=10105

a manual patch is on the secon page in case you got problems using the patch file.

Posted by Terefang
you could edit the irrlicht source file directly by finding the following codeblock around line 403:

Code: Select all

#ifdef GLX_VERSION_1_4
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddress
  #else
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB
#endif
and change it to:

Code: Select all

#ifndef GLX_ARB_get_proc_address
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddress
  #else
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB
#endif
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Post by Iaro »

Thanks, Afecelis but that was already the method I used.

Some extra data : I have the following libraries installed : freeglut-dev, libxext-dev, xxf86vm-dev, libpng-dev ( I got another error with make so i installed this ), and nvidia-glx dev.
Are there some other libraries that I need or will these be enough ?


EDIT :

After some more searching I managed to make it work :D .

The code from COpenGLDriver:

Code: Select all

#ifdef GLX_VERSION_1_4

	#define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB

	#else

	#define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB

	#endif
and I also added this line to COpenGlTexture :
#define GLX_GLXEXT_PROTOTYPES
Post Reply