litedrive
13th January 2012, 18:25
...And I'm running the most recent version of Qt (which, unless I'm wrong, is 4.8.0).
What could be the issue here? So far the project I'm working on builds on Ubuntu and Windows perfectly fine, yet it won't build on Arch Linux because of this. I spoke with someone else who was running Arch as well and he too had problems building the project. The interesting thing is that while he got his Qt from Pacman, I wound up downloading the QtSDK. I'll post an example of the ppdirectives:
#pragma once
#include <list>
#include <QGLWidget>
#include <GL/glext.h>
#include "SharedPtr.h"
#include "Shape.h"
#include "Vec2f.h"
And the actual header file:
class BoxOfShapes
: public QGLWidget
{
Q_OBJECT
public:
explicit BoxOfShapes( QWidget* parent, float width, float height );
virtual ~BoxOfShapes( void );
void addShape( std::shared_ptr< Shape > shape );
public slots:
void doPhysics( void );
void resetWorld( void );
signals:
void numShapesChanged( int numShapes );
protected:
std::list< shared_ptr< Shape > > collide( std::list< shared_ptr< Shape > > toCollide );
std::list< shared_ptr< Shape > > explode( std::list< shared_ptr< Shape > > toExplode );
int heightForWidth( int w ) { return w; }
void initializeGL( void );
void move( std::list< shared_ptr< Shape > >& toMove );
void paintGL( void );
virtual void Render( void );
void resizeGL( int width, int height );
Vec2f mDims;
std::list< shared_ptr< Shape > > mShapes;
std::list< shared_ptr< Shape > > mParticles;
};
And the error...
void BoxOfShapes::paintGL( void )
{
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluOrtho2D( 0, width(), 0, height() );
glClear( GL_COLOR_BUFFER_BIT );
Render();
}
‘gluOrtho2D’ was not declared in this scope
void BoxOfShapes::resizeGL( int width, int height )
{
if ( height == 0 ) height = 1;
if ( width == 0 ) width = 1;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 8.0f );
glMatrixMode( GL_MODELVIEW );
}
‘gluPerspective’ was not declared in this scope
I have no idea how this could be, but for whatever reason it appears that QGLWidget isn't registering the glu library. Is there a way to edit this?
What could be the issue here? So far the project I'm working on builds on Ubuntu and Windows perfectly fine, yet it won't build on Arch Linux because of this. I spoke with someone else who was running Arch as well and he too had problems building the project. The interesting thing is that while he got his Qt from Pacman, I wound up downloading the QtSDK. I'll post an example of the ppdirectives:
#pragma once
#include <list>
#include <QGLWidget>
#include <GL/glext.h>
#include "SharedPtr.h"
#include "Shape.h"
#include "Vec2f.h"
And the actual header file:
class BoxOfShapes
: public QGLWidget
{
Q_OBJECT
public:
explicit BoxOfShapes( QWidget* parent, float width, float height );
virtual ~BoxOfShapes( void );
void addShape( std::shared_ptr< Shape > shape );
public slots:
void doPhysics( void );
void resetWorld( void );
signals:
void numShapesChanged( int numShapes );
protected:
std::list< shared_ptr< Shape > > collide( std::list< shared_ptr< Shape > > toCollide );
std::list< shared_ptr< Shape > > explode( std::list< shared_ptr< Shape > > toExplode );
int heightForWidth( int w ) { return w; }
void initializeGL( void );
void move( std::list< shared_ptr< Shape > >& toMove );
void paintGL( void );
virtual void Render( void );
void resizeGL( int width, int height );
Vec2f mDims;
std::list< shared_ptr< Shape > > mShapes;
std::list< shared_ptr< Shape > > mParticles;
};
And the error...
void BoxOfShapes::paintGL( void )
{
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluOrtho2D( 0, width(), 0, height() );
glClear( GL_COLOR_BUFFER_BIT );
Render();
}
‘gluOrtho2D’ was not declared in this scope
void BoxOfShapes::resizeGL( int width, int height )
{
if ( height == 0 ) height = 1;
if ( width == 0 ) width = 1;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 8.0f );
glMatrixMode( GL_MODELVIEW );
}
‘gluPerspective’ was not declared in this scope
I have no idea how this could be, but for whatever reason it appears that QGLWidget isn't registering the glu library. Is there a way to edit this?