What I want is to get a vector of MYSTRUCT values like this
vector<MYSTRUCT> newstruct = get_vector();
The get_vector() function is created inside a DLL file. I am trying to use it in my project, so I have to declare it into a .h file. The declaration is like this
vector<MYSTRUCT> get_vector();
At compiling I get an error for this too
header.h|25|error: expected constructor, destructor, or type conversion before '<' token|
I am a little lost because this is new for me. A little help will be so appreciated. Thank you!
@alexbnc: Your compiler is set to compile C++ code, right? And not C? Because by the looks of those linkage errors, the compiler doesn't know what templates are, and doesn't know how to link them.
The compiler problem is solved now.
My project contains a GUI application and a Shared library.
The structure is defined into the .cpp and .h file of the Shared library. By including the .h file into the GUI project I can access the DLL functions and variables, those declared into it.
Everything is exported with no problem. The only problem is that the library header (that creates functions and variables references for the GUI projects) give an error when trying to compile the GUI project. It'l like the vector function is not understood. I can define a int, char*, or whatever function type but not vector<of STRUCT> function