Sign in to follow this  

Linker Errors with a .lib

Recommended Posts

So I've created a .lib that has all my base code. Though for some reason when ever I try to use a function in my library that references another function within the same library I get a linker error. Is it not possible to do this, More specifically... // God is this ugly... SampleApp error LNK2019: unresolved external symbol "float __cdecl math::Vector3DotProduct(class math::Vector3 const &,class math::Vector3 const &)" (?Vector3DotProduct@math@@YAMABVVector3@1@0@Z) referenced in function "class math::Vector3 __cdecl Vector3Projection(class math::Vector3 const &,class math::Vector3 const &)" (?Vector3Projection@@YA?AVVector3@math@@ABV12@0@Z) So here is where I get the referenced in part of the function
void Vector3Projection( const Vector3& u, const Vector3& v, Vector3& returnVec )
	float magnitude = math::Vector3Length( v );

	if( magnitude )
		returnVec = ( ( math::Vector3DotProduct( u, v ) / ( magnitude * magnitude ) ) * v );
Here is the prototype for DotProduct float Vector3DotProduct ( const Vector3& vec1, const Vector3& vec2 ); And here is the implementation float Vector3DotProduct( const Vector3& vec1, const Vector3& vec2 ) { return ( vec1.x * vec2.x ) + ( vec1.y * vec2.y ) + ( vec1.z * vec2.z ); }

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this