You are not logged in.

#1 2015-03-27 23:30:22

Axell
Member
Registered: 2009-01-11
Posts: 43

C++/OpenGL: Cannot find GLdouble from gl.h

Hi!

I'm try to build a very basic OpenGL application with freeglut. I include GL/glut.h to setup context but gcc complains about using GLdouble in glut.h:

/usr/include/GL/glu.h:300:54: error: ‘GLdouble’ has not been declared

I tried to declare a variable of type GLdouble and it also doesn't work for the same reason. I did use glut for about a year ago... But now I'm stuck.
GL/gl.h is present and all the typedefs are defined there.
Did anybody had the same issue? Not sure if it's my mistake or packaging issue or something else.

Compile with -std=c++11 -lpthread -lGL -lglut

Thanks.

Offline

#2 2015-03-28 00:03:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: C++/OpenGL: Cannot find GLdouble from gl.h

Which mesa package do you have installed?  The needed gl.h is only provided by [extra]/mesa, so is that installed?

EDIT: sorry, I need to learn to read better - you already have this info in your post.

Have you checked environment variables for anything that could be picked up by the preprocessor to skip relevant header sections?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-03-28 08:01:19

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: C++/OpenGL: Cannot find GLdouble from gl.h

Hi Axell,

I'm not an OpenGL expert, but can you provide the output of the following commands?

pacman -Qo /usr/include/GL/gl.h
pacman -Qo /usr/include/GL/glu.h
pacman -Qo /usr/include/GL/glut.h
Axell wrote:

Compile with -std=c++11 -lpthread -lGL -lglut

I'm assuming that your application is written in C++, so can you compile the following code or it fails too?

#include <GL/glut.h>
#include <iostream>

using namespace std;

int main(void)
{
  GLdouble a = 123.456; 
  cout << "This is a GLdouble: " <<  a << endl;
}

About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#4 2015-03-28 13:17:37

Axell
Member
Registered: 2009-01-11
Posts: 43

Re: C++/OpenGL: Cannot find GLdouble from gl.h

Thanks for the replies.

can you compile the following code

and it did compile. So it seems that cmake setup has errors. Thank you! Will try to find out what is wrong with make files.

Offline

Board footer

Powered by FluxBB