Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SZupek

Member Since 26 Mar 2012
Offline Last Active Mar 26 2012 01:51 PM

Posts I've Made

In Topic: 1st Triangle program compiles, but doesn't run (with errors) from OPENGL SB5

26 March 2012 - 01:54 PM

I have since switched over to code::blocks for the sake that it appears to be a more user friendly IDE. However, now I am getting a problem in the actual OPENGL code about type mismatch or something along those lines.

Actually it's from math3d.h which is provided by the OpenGL Superbible book (which is for OpenGL version 3+);

||warning: command line option ‘-std=c++0x’ is valid for C++/ObjC++ but not for C [enabled by default]|
/usr/include/math3d.h|148|error: conflicting types for ‘m3dLoadVector2’|
/usr/include/math3d.h|146|note: previous definition of ‘m3dLoadVector2’ was here|
/usr/include/math3d.h|152|error: conflicting types for ‘m3dLoadVector3’|
/usr/include/math3d.h|150|note: previous definition of ‘m3dLoadVector3’ was here|
/usr/include/math3d.h|156|error: conflicting types for ‘m3dLoadVector4’|
/usr/include/math3d.h|154|note: previous definition of ‘m3dLoadVector4’ was here|
/usr/include/math3d.h|163|error: conflicting types for ‘m3dCopyVector2’|
/usr/include/math3d.h|162|note: previous definition of ‘m3dCopyVector2’ was here|
/usr/include/math3d.h|166|error: conflicting types for ‘m3dCopyVector3’|
/usr/include/math3d.h|165|note: previous definition of ‘m3dCopyVector3’ was here|
/usr/include/math3d.h|169|error: conflicting types for ‘m3dCopyVector4’|
||warning: command line option ‘-std=c++0x’ is valid for C++/ObjC++ but not for C [enabled by default]|
/usr/include/math3d.h|148|error: conflicting types for ‘m3dLoadVector2’|
/usr/include/math3d.h|146|note: previous definition of ‘m3dLoadVector2’ was here|
/usr/include/math3d.h|152|error: conflicting types for ‘m3dLoadVector3’|
/usr/include/math3d.h|150|note: previous definition of ‘m3dLoadVector3’ was here|
/usr/include/math3d.h|156|error: conflicting types for ‘m3dLoadVector4’|
/usr/include/math3d.h|154|note: previous definition of ‘m3dLoadVector4’ was here|
/usr/include/math3d.h|163|error: conflicting types for ‘m3dCopyVector2’|
/usr/include/math3d.h|162|note: previous definition of ‘m3dCopyVector2’ was here|
/usr/include/math3d.h|166|error: conflicting types for ‘m3dCopyVector3’|
/usr/include/math3d.h|165|note: previous definition of ‘m3dCopyVector3’ was here|
/usr/include/math3d.h|169|error: conflicting types for ‘m3dCopyVector4’|
/usr/include/math3d.h|168|note: previous definition of ‘m3dCopyVector4’ was here|
/usr/include/math3d.h|176|error: conflicting types for ‘m3dAddVectors2’|
/usr/include/math3d.h|174|note: previous definition of ‘m3dAddVectors2’ was here|
/usr/include/math3d.h|181|error: conflicting types for ‘m3dAddVectors3’|
/usr/include/math3d.h|179|note: previous definition of ‘m3dAddVectors3’ was here|
/usr/include/math3d.h|186|error: conflicting types for ‘m3dAddVectors4’|
/usr/include/math3d.h|184|note: previous definition of ‘m3dAddVectors4’ was here|
/usr/include/math3d.h|193|error: conflicting types for ‘m3dSubtractVectors2’|
/usr/include/math3d.h|191|note: previous definition of ‘m3dSubtractVectors2’ was here|
/usr/include/math3d.h|198|error: conflicting types for ‘m3dSubtractVectors3’|
/usr/include/math3d.h|196|note: previous definition of ‘m3dSubtractVectors3’ was here|
/usr/include/math3d.h|203|error: conflicting types for ‘m3dSubtractVectors4’|
/usr/include/math3d.h|201|note: previous definition of ‘m3dSubtractVectors4’ was here|
/usr/include/math3d.h|212|error: conflicting types for ‘m3dScaleVector2’|
/usr/include/math3d.h|210|note: previous definition of ‘m3dScaleVector2’ was here|
/usr/include/math3d.h|217|error: conflicting types for ‘m3dScaleVector3’|
/usr/include/math3d.h|215|note: previous definition of ‘m3dScaleVector3’ was here|
/usr/include/math3d.h|222|error: conflicting types for ‘m3dScaleVector4’|
/usr/include/math3d.h|220|note: previous definition of ‘m3dScaleVector4’ was here|
/usr/include/math3d.h|237|error: conflicting types for ‘m3dCrossProduct3’|
/usr/include/math3d.h|230|note: previous definition of ‘m3dCrossProduct3’ was here|
/usr/include/math3d.h|250|error: conflicting types for ‘m3dDotProduct3’|
/usr/include/math3d.h|247|note: previous definition of ‘m3dDotProduct3’ was here|
/usr/include/math3d.h||In function ‘m3dGetAngleBetweenVectors3’:|
/usr/include/math3d.h|258|error: expected expression before ‘float’|
/usr/include/math3d.h|261|error: conflicting types for ‘m3dGetAngleBetweenVectors3’|
/usr/include/math3d.h|255|note: previous definition of ‘m3dGetAngleBetweenVectors3’ was here|
/usr/include/math3d.h|273|error: conflicting types for ‘m3dGetVectorLengthSquared3’|
/usr/include/math3d.h|270|note: previous definition of ‘m3dGetVectorLengthSquared3’ was here|
/usr/include/math3d.h|282|error: conflicting types for ‘m3dGetVectorLength3’|
/usr/include/math3d.h|279|note: previous definition of ‘m3dGetVectorLength3’ was here|
/usr/include/math3d.h|291|error: conflicting types for ‘m3dNormalizeVector3’|
/usr/include/math3d.h|288|note: previous definition of ‘m3dNormalizeVector3’ was here|
/usr/include/math3d.h|300|error: conflicting types for ‘m3dGetDistanceSquared3’|
/usr/include/math3d.h|299|note: previous declaration of ‘m3dGetDistanceSquared3’ was here|
/usr/include/math3d.h|305|error: conflicting types for ‘m3dGetDistance3’|
/usr/include/math3d.h|302|note: previous definition of ‘m3dGetDistance3’ was here|
/usr/include/math3d.h|309|error: conflicting types for ‘m3dGetMagnitudeSquared3’|
/usr/include/math3d.h|308|note: previous definition of ‘m3dGetMagnitudeSquared3’ was here|
/usr/include/math3d.h|312|error: conflicting types for ‘m3dGetMagnitude3’|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 1 warnings ===|
/usr/include/math3d.h|168|note: previous definition of ‘m3dCopyVector4’ was here|
/usr/include/math3d.h|176|error: conflicting types for ‘m3dAddVectors2’|
/usr/include/math3d.h|174|note: previous definition of ‘m3dAddVectors2’ was here|
/usr/include/math3d.h|181|error: conflicting types for ‘m3dAddVectors3’|
/usr/include/math3d.h|179|note: previous definition of ‘m3dAddVectors3’ was here|
/usr/include/math3d.h|186|error: conflicting types for ‘m3dAddVectors4’|
/usr/include/math3d.h|184|note: previous definition of ‘m3dAddVectors4’ was here|
/usr/include/math3d.h|193|error: conflicting types for ‘m3dSubtractVectors2’|
/usr/include/math3d.h|191|note: previous definition of ‘m3dSubtractVectors2’ was here|
/usr/include/math3d.h|198|error: conflicting types for ‘m3dSubtractVectors3’|
/usr/include/math3d.h|196|note: previous definition of ‘m3dSubtractVectors3’ was here|
/usr/include/math3d.h|203|error: conflicting types for ‘m3dSubtractVectors4’|
/usr/include/math3d.h|201|note: previous definition of ‘m3dSubtractVectors4’ was here|
/usr/include/math3d.h|212|error: conflicting types for ‘m3dScaleVector2’|
/usr/include/math3d.h|210|note: previous definition of ‘m3dScaleVector2’ was here|
/usr/include/math3d.h|217|error: conflicting types for ‘m3dScaleVector3’|
/usr/include/math3d.h|215|note: previous definition of ‘m3dScaleVector3’ was here|
/usr/include/math3d.h|222|error: conflicting types for ‘m3dScaleVector4’|
/usr/include/math3d.h|220|note: previous definition of ‘m3dScaleVector4’ was here|
/usr/include/math3d.h|237|error: conflicting types for ‘m3dCrossProduct3’|
/usr/include/math3d.h|230|note: previous definition of ‘m3dCrossProduct3’ was here|
/usr/include/math3d.h|250|error: conflicting types for ‘m3dDotProduct3’|
/usr/include/math3d.h|247|note: previous definition of ‘m3dDotProduct3’ was here|
/usr/include/math3d.h||In function ‘m3dGetAngleBetweenVectors3’:|
/usr/include/math3d.h|258|error: expected expression before ‘float’|
/usr/include/math3d.h|261|error: conflicting types for ‘m3dGetAngleBetweenVectors3’|
/usr/include/math3d.h|255|note: previous definition of ‘m3dGetAngleBetweenVectors3’ was here|
/usr/include/math3d.h|273|error: conflicting types for ‘m3dGetVectorLengthSquared3’|
/usr/include/math3d.h|270|note: previous definition of ‘m3dGetVectorLengthSquared3’ was here|
/usr/include/math3d.h|282|error: conflicting types for ‘m3dGetVectorLength3’|
/usr/include/math3d.h|279|note: previous definition of ‘m3dGetVectorLength3’ was here|
/usr/include/math3d.h|291|error: conflicting types for ‘m3dNormalizeVector3’|
/usr/include/math3d.h|288|note: previous definition of ‘m3dNormalizeVector3’ was here|
/usr/include/math3d.h|300|error: conflicting types for ‘m3dGetDistanceSquared3’|
/usr/include/math3d.h|299|note: previous declaration of ‘m3dGetDistanceSquared3’ was here|
/usr/include/math3d.h|305|error: conflicting types for ‘m3dGetDistance3’|
/usr/include/math3d.h|302|note: previous definition of ‘m3dGetDistance3’ was here|
/usr/include/math3d.h|309|error: conflicting types for ‘m3dGetMagnitudeSquared3’|
/usr/include/math3d.h|308|note: previous definition of ‘m3dGetMagnitudeSquared3’ was here|
/usr/include/math3d.h|312|error: conflicting types for ‘m3dGetMagnitude3’|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 1 warnings ===|



And it's crying about this OPENGL code
inline void m3dLoadVector2(M3DVector2d v, const float x, const float y)

LINE 148 in math3d.h

Any idea? The code came straight from the book/cd

In Topic: 1st Triangle program compiles, but doesn't run (with errors) from OPENGL SB5

26 March 2012 - 12:02 PM

I believe it is missing a link library, but here are the libraries i have linked

BOOK1 (project name)
-- gl
-- glew
-- glu
---- gl
-- libglfw

PARTNERS