Hello,
I have a C souces that i want to wrap and export from dll library. For example:
C_lang_struct_and_enum.h:
typedef struct
{
int x;
double y;
} AStruct;
typedef enum
{
a,
b,
c
} AnEnum;
I also have a few C - functions using them:
C_lang_functions.h:
void PrintAStruct(AStruct s,AnEnum value)
{
/*print stuff*/
}
I want to export those functions with wrappers:
CppDLL.cpp:
namespace SomeNamespace
{
void wrapPrintAStruct(wrapAStruct s,wrapAnEnum value) //wrapper
{
PrintAStruct(s,value);
}
}
CppDLL.h:
#ifdef CPP_DLL_EXPORTS
#define CPP_DLL_API __declspec(dllexport)
#else
#define CPP_DLL_API __declspec(dllimport)
#endif
namespace SomeNamespace
{
typedef AStruct CPP_DLL_API wrapAStruct;
typedef AnEnum CPP_DLL_API wrapAnEnum;
CPP_DLL_API void wrapPrintAStruct(AStruct s,AnEnum value);
}
The DLL library is built succesfully, but I cannot use those symbols in a program as they seem to be undefined. How to workaround this? Any solution would be fine really.