I can not export the class:
#ifndef SDBIDI #define SDBIDI #ifndef SDBIDI_FLAG #define SDBIDI_ORIENT __declspec(dllimport) #else #define SDBIDI_ORIENT __declspec(dllexport) #endif #include "TCInfoSuVars.h" //class is here! SDBIDI_ORIENT int myFoo(FILE *file); // exporting function #endif
class definition in TCInfoSuVars.h
#pragma once #include <string> #include <hash_map> class SDBIDI_ORIENT TCInfoSuVars { public: std::string id; std::string tcVal; TCInfoSuVars(); TCInfoSuVars(std::string _tcVal, std::string _id); ~TCInfoSuVars(); };
Getting error:
myProgram.cpp
#define SDBIDI_FLAG
exit:
TCInfoSuVars.h(14) : error C2470: 'TCInfoSuVars' : looks like a function definition, but there is no parameter list; skipping apparent body
And if I write
class __declspec(dllexport) TCInfoSuVars
everything is working fine.
Thanks!
c ++ class visual-studio-2005
VextoR
source share