Fix linker problem

This fixes the linker problem:

/usr/bin/ld: error: ../../libraries/shared/libshared.a(StreamUtils.cpp.o): multiple
definition of 'operator<<(std::ostream&, glm::detail::tvec3<float, (glm::precision)0> const&)'
/usr/bin/ld: CMakeFiles/physics-tests.dir/src/PhysicsTestUtil.cpp.o: previous definition here
/usr/bin/ld: error: ../../libraries/shared/libshared.a(StreamUtils.cpp.o): multiple
definition of 'operator<<(std::ostream&, glm::detail::tquat<float, (glm::precision)0> const&)'
/usr/bin/ld: CMakeFiles/physics-tests.dir/src/PhysicsTestUtil.cpp.o: previous definition here
/usr/bin/ld: error: ../../libraries/shared/libshared.a(StreamUtils.cpp.o): multiple
definition of 'operator<<(std::ostream&, glm::detail::tmat4x4<float, (glm::precision)0> const&)'
/usr/bin/ld: CMakeFiles/physics-tests.dir/src/PhysicsTestUtil.cpp.o: previous definition here
collect2: error: ld returned 1 exit status

Note these are the serializers to std::ostream that were already there, not the ones
that I added (which are to QDebug). This bug was already there, I only got these errors
now after adding some debug code.

The reason is obvious: they are already defined in libshared.a (through StreamUtils.cpp).
No need to define them again in ./tests/physics/src/PhysicsTestUtil.cpp
This commit is contained in:
Aleric Inglewood 2014-07-13 21:54:07 +02:00 committed by Carlo Wood
parent 13c2c69d06
commit 147a4119cb
2 changed files with 1 additions and 22 deletions

View file

@ -12,25 +12,7 @@
#include <glm/gtc/type_ptr.hpp>
#include "PhysicsTestUtil.h"
std::ostream& operator<<(std::ostream& s, const glm::vec3& v) {
s << "<" << v.x << "," << v.y << "," << v.z << ">";
return s;
}
std::ostream& operator<<(std::ostream& s, const glm::quat& q) {
s << "<" << q.x << "," << q.y << "," << q.z << "," << q.w << ">";
return s;
}
std::ostream& operator<<(std::ostream& s, const glm::mat4& m) {
s << "[";
for (int j = 0; j < 4; ++j) {
s << " " << m[0][j] << " " << m[1][j] << " " << m[2][j] << " " << m[3][j] << ";";
}
s << " ]";
return s;
}
#include "StreamUtils.h"
std::ostream& operator<<(std::ostream& s, const CollisionInfo& c) {
s << "[penetration=" << c._penetration

View file

@ -21,9 +21,6 @@ const glm::vec3 xAxis(1.f, 0.f, 0.f);
const glm::vec3 yAxis(0.f, 1.f, 0.f);
const glm::vec3 zAxis(0.f, 0.f, 1.f);
std::ostream& operator<<(std::ostream& s, const glm::vec3& v);
std::ostream& operator<<(std::ostream& s, const glm::quat& q);
std::ostream& operator<<(std::ostream& s, const glm::mat4& m);
std::ostream& operator<<(std::ostream& s, const CollisionInfo& c);
#endif // hifi_PhysicsTestUtil_h