paroj / gltut

Learning Modern 3D Graphics Programming
https://paroj.github.io/gltut/
MIT License
1.57k stars 377 forks source link

Error building tut 12 and 16 #63

Closed paroj closed 8 years ago

paroj commented 11 years ago

Originally reported by: chrisandrewca (Bitbucket: chrisandrewca, GitHub: chrisandrewca)


Tried with gcc 4.7.2-5 on debian and clang/clang++. Probably something on my end so I'll be trying to figure it out. The source is from the current trunk.

=== Building framework (debug) ====
==== Building Tut 12 Scene Lighting (debug) ====
Lights.cpp
In file included from Lights.h:8:0,
                 from Lights.cpp:9:
../framework/Interpolators.h: In instantiation of ‘void Framework::ConstVelLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<glm::detail::tvec3<float> >; ValueType = glm::detail::tvec3<float>]’:
Lights.cpp:62:35:   required from here
../framework/Interpolators.h:179:5: error: ‘distance’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:34:7: note: ‘float distance(const vec3&, const vec3&)’ declared here, later in the translation unit
In file included from Lights.h:8:0,
                 from Lights.cpp:9:
../framework/Interpolators.h: In instantiation of ‘void Framework::TimedLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<std::pair<glm::detail::tvec4<float>, float> >; ValueType = glm::detail::tvec4<float>]’:
Lights.cpp:145:41:   required from here
../framework/Interpolators.h:72:5: error: ‘GetValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:129:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from Lights.h:8:0,
                 from Lights.cpp:9:
../framework/Interpolators.h:73:5: error: ‘GetTime’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:130:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from Lights.h:8:0,
                 from Lights.cpp:9:
../framework/Interpolators.h: In instantiation of ‘void Framework::TimedLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<std::pair<float, float> >; ValueType = float]’:
Lights.cpp:151:58:   required from here
../framework/Interpolators.h:72:5: error: ‘GetValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:129:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from Lights.h:8:0,
                 from Lights.cpp:9:
../framework/Interpolators.h:73:5: error: ‘GetTime’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:130:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit
make[1]: *** [obj/Debug/Tut 12 Scene Lighting/Lights.o] Error 1
make: *** [Tut 12 Scene Lighting] Error 2

Linking Tut 16 Gamma Checkers
==== Building Tut 16 Gamma Landscape (debug) ====
Creating obj/Debug/Tut 16 Gamma Landscape
Gamma Landscape.cpp
LightEnv.cpp
In file included from /usr/include/c++/4.7/backward/strstream:52:0,
                 from ../framework/rapidxml_helpers.h:6,
                 from LightEnv.cpp:14:
/usr/include/c++/4.7/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
In file included from LightEnv.h:9:0,
                 from LightEnv.cpp:10:
../framework/Interpolators.h: In instantiation of ‘void Framework::TimedLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<std::pair<glm::detail::tvec4<float>, float> >; ValueType = glm::detail::tvec4<float>]’:
LightEnv.cpp:137:41:   required from here
../framework/Interpolators.h:72:5: error: ‘GetValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
LightEnv.cpp:28:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from LightEnv.h:9:0,
                 from LightEnv.cpp:10:
../framework/Interpolators.h:73:5: error: ‘GetTime’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
LightEnv.cpp:29:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from LightEnv.h:9:0,
                 from LightEnv.cpp:10:
../framework/Interpolators.h: In instantiation of ‘void Framework::TimedLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<std::pair<float, float> >; ValueType = float]’:
LightEnv.cpp:140:51:   required from here
../framework/Interpolators.h:72:5: error: ‘GetValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
LightEnv.cpp:28:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from LightEnv.h:9:0,
                 from LightEnv.cpp:10:
../framework/Interpolators.h:73:5: error: ‘GetTime’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
LightEnv.cpp:29:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from LightEnv.h:9:0,
                 from LightEnv.cpp:10:
../framework/Interpolators.h: In instantiation of ‘void Framework::ConstVelLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<glm::detail::tvec3<float> >; ValueType = glm::detail::tvec3<float>]’:
LightEnv.cpp:168:40:   required from here
../framework/Interpolators.h:179:5: error: ‘distance’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
LightEnv.cpp:31:7: note: ‘float distance(const vec3&, const vec3&)’ declared here, later in the translation unit
make[1]: *** [obj/Debug/Tut 16 Gamma Landscape/LightEnv.o] Error 1
make: *** [Tut 16 Gamma Landscape] Error 2

paroj commented 11 years ago

Original comment by Giuseppe Barbieri (Bitbucket: gbarbieri, GitHub: gbarbieri):


Pasting that in Lights.h made it compilable, thanks

paroj commented 11 years ago

Original comment by patstew (Bitbucket: patstew, GitHub: patstew):


You need to add

#!c++
typedef std::pair<float, float> MaxIntensityData;
typedef std::vector<MaxIntensityData> MaxIntensityVector;
typedef std::pair<glm::vec4, float> LightVectorData;
typedef std::vector<LightVectorData> LightVector;

float distance(const glm::vec3 &lhs, const glm::vec3 &rhs);
glm::vec4 GetValue(const LightVectorData &data);
float GetTime(const LightVectorData &data);
float GetValue(const MaxIntensityData &data);
float GetTime(const MaxIntensityData &data);

above

#!c++
#include "../framework/Interpolators.h"

in Lights.h/LightEnv.h