Hello everyone,
I was wondering if someone can help me figuring out some errors I keep getting when I try to create a dll library from existing c++ code using VS2005. The issue is related to a class that returns a vector of objects. There is no errors when I compile this in c++ "linux" and it works find but the issue is with the VS2005. Here is what I have:
I have two classes:
student class
namespace StudentClass{
student::student(); //constructor
//this contains all the methods for getting and setting student records
}
registered students class //contains method that returns a class of student's objects based on some kind of criteria
namespace RegStudentClass{
registeredstud::registeredstud(); //constructor
std::vector<student::student * > registeredstud::get_registered_students(); //I read online that I need the * in here. In fact this reduces my errors too
{
vector< student::student * > myStudVect; /temp vector
//logic to get the list of my students' objects and push_pack to the myStudVect vector
return myStudVect;
}
}
in the header file for this class
namespace RegStudentClass {
public ref class registeredstudent
{
public:
registeredstudent::registerstudent();
std::vector< student::student* > get_registered_students();
}
}
I get the following errors:
error C3699: '*' : cannot use this indirection on type "student::student"
Basically this error appears whereever I called the vector<student::student *>.
Can someone tell me what is the cause of this error and how to resolve it. Also if there is a better way to create the vector than the way I am doing it. I would appreciate any kind of help.
Jazi