views:

55

answers:

1

Hey S.O. Guys

I am currently trying to write a basic wrapper for the cml (http://www.cmldev.net/) math library for a project i am working on. I have a wrapper for the cml vector class which has one private member

#ifndef VECTOR3_H_
#define VECTOR3_H_

#include "cml\cml.h"
#include <memory>

namespace Math
{
    template<typename T>

    class Vector3
    {
    public:
        Vector3( void ) 
        Vector3(T x, T y, T z); 
        ~Vector3(){};

        //@Function: Set
        //@Description: Set the internals of the vector
        //@Parameters: 3 values x, y, z
        void set(T x, T y, T z);

    private:
        // ------------------------------------------------------------
        // Copy constructor and assignment operator should be private
        Vector3             (const Vector3 &);
        Vector3& operator=  (const Vector3 &);
        //-------------------------------------------------------------

        std::auto_ptr<cml::vector<T, cml::fixed<3, -1>> *m_internalVector ;
    };
}

(Note i have left out implementations of the constructors to keep the size down)

and in another file i use some #defines to make my word easier.

//Vectors
typedef Math::Vector3<float> Vector3f;
//typedef cml::vector2f Vector2f;

typedef Math::Vector3<int> Vector3i;
//typedef cml::vector2i Vector2i;

Now my issue occurs when i try to use Vector3f

Vector3f forwards( 0.0f, 0.0f, 1.0f );

and i get the error: "No instance of constructor 'Math::Vector3::Vector3 [with T = float]' Matches Argument List"

I have tried changing from auto_ptr to a regular pointer in case it was an issue with the templating also have tried to declare the variable without using the #define and the same issue occurs, am i missing something here because i can see that constructor in my implementation.

Thanks for any advice you can give.

-Craig

A: 

You're missing a ; after the Vector3(void) constructor.

(But I have to admit that I thought that this was just a typo in the question, not necessarily the real cause of the problem.)

sth