S
saneman
I have some code that compiles fine with g++ (gnu c++ compiler for linux):
#include <math_types.h>
int main() {
//graphics::MyMathTypes::vector3_type v1;
typedef graphics::MyMathTypes math_types;
typedef math_types::matrix4x4_type matrix4x4_type;
typedef math_types::vector3_type vector3_type;
typedef math_types::real_type real_type;
matrix4x4_type m1;
vector3_type v1;
vector3_type v2;
Dot(v1, v2);
return 0;
}
But when I try to compile the same code on windows XP with visual studio
2008 I get:
1>test.obj : error LNK2019: unresolved external symbol "public: virtual
__thiscall Matrix<float,4,4>::~Matrix<float,4,4>(void)"
(??1?$Matrix@M$03$03@@UAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "public: virtual
__thiscall ColumnVector<float,3>::~ColumnVector<float,3>(void)"
(??1?$ColumnVector@M$02@@UAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "float __cdecl
Dot<float,3>(class ColumnVector<float,3> const &,class ColumnVector<float,3>
const &)" (??$Dot@M$02@@YAMABV?$ColumnVector@M$02@@0@Z) referenced in
function _main
1>test.obj : error LNK2019: unresolved external symbol "public: __thiscall
ColumnVector<float,3>::ColumnVector<float,3>(void)"
(??0?$ColumnVector@M$02@@QAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "public: __thiscall
Matrix<float,4,4>::Matrix<float,4,4>(void)" (??0?$Matrix@M$03$03@@QAE@XZ)
referenced in function _main
What might be causing these linking errors?
#include <math_types.h>
int main() {
//graphics::MyMathTypes::vector3_type v1;
typedef graphics::MyMathTypes math_types;
typedef math_types::matrix4x4_type matrix4x4_type;
typedef math_types::vector3_type vector3_type;
typedef math_types::real_type real_type;
matrix4x4_type m1;
vector3_type v1;
vector3_type v2;
Dot(v1, v2);
return 0;
}
But when I try to compile the same code on windows XP with visual studio
2008 I get:
1>test.obj : error LNK2019: unresolved external symbol "public: virtual
__thiscall Matrix<float,4,4>::~Matrix<float,4,4>(void)"
(??1?$Matrix@M$03$03@@UAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "public: virtual
__thiscall ColumnVector<float,3>::~ColumnVector<float,3>(void)"
(??1?$ColumnVector@M$02@@UAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "float __cdecl
Dot<float,3>(class ColumnVector<float,3> const &,class ColumnVector<float,3>
const &)" (??$Dot@M$02@@YAMABV?$ColumnVector@M$02@@0@Z) referenced in
function _main
1>test.obj : error LNK2019: unresolved external symbol "public: __thiscall
ColumnVector<float,3>::ColumnVector<float,3>(void)"
(??0?$ColumnVector@M$02@@QAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "public: __thiscall
Matrix<float,4,4>::Matrix<float,4,4>(void)" (??0?$Matrix@M$03$03@@QAE@XZ)
referenced in function _main
What might be causing these linking errors?