I am trying to take some functions that I've made and tested with in a standalone application. Now that I am trying to make a DLL I am getting a few errors stating that the function has been redefined and that the return parameters don't match. This seems to be the only time I am getting these errors, I've tested it by removing this class and it compiles fine as well as the stand-alone app with a main.cpp referencing these directly. Below are the errors and the h and cpp files:
Error 7 error C2371: 'Parser::parse' : redefinition; different basic types c:\users\seb\documents\visual studio 2005\projects\TestDLL\TestDLL\parser.cpp 17
Error 4 error C2526: 'Parser::parse' : C linkage function cannot return C++ class 'std::vector<_Ty>' c:\users\seb\documents\visual studio 2005\projects\TestDLL\TestDLL\parser.h 28
Error 6 error C2556: 'IDVec Parser::parse(const char *)' : overloaded function differs only by return type from 'void Parser::parse(const char *)' c:\users\seb\documents\visual studio 2005\projects\TestDLL\TestDLL\parser.cpp 17
Also find the .h file and the function from the .cpp as well:
Parser.h
#ifndef PARSER_H
#define PARSER_H
#if defined DLL_EXPORT
#define TESTAPI __declspec(dllexport)
#else
#define TESTAPI __declspec(dllimport)
#endif
#include <iostream>
#include <vector>
typedef struct _ListEntry {
std::string id, path;
} ListEntry;
typedef std::vector<ListEntry> IDVec;
extern "C"
{
class TESTAPI Parser
{
public:
Parser(void);
~Parser(void);
static IDVec parse(const char* Buffer);
private:
static size_t nextLine(std::string& rstrText, size_t pos);
static std::string nextWord(std::string& rstrText, size_t pos);
static void fixOSSpecificPath(std::string& rstrPath);
};
}
#endif
Parser.cpp
IDVec Parser::parse(const char* Buffer)
{
std::string s = Buffer;
IDVec v;
// Doing stuff here
return v;
}
Thanks for any advice