P
Peter Steele
I've created an unmanaged C++ DLL and when I compile it I get numerous
errors of the form
xyz.cpp(nnn): warning C4273: '<somefunction>' : inconsistent dll linkage
I have other DLLs that have been created using the same basic pattern. I
using the approach where the following code appears in the .h file:
#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif
Each of the functions in the .h file are prefixed with this macro:
MYDLL_API unsigned int myfunc();
The DLL project defines the MYDLL_EXPORTS symbol so that the specified
functions are exported. Conversely, any app that includes this .h file will
not have the macro defined and will use the dllimport directive.
So, this is my basic approach to creating my DLLs. In a couple of cases I'm
getting these warning messages. I'm obviously missing something obvious but
I can't figure it out. The DLLs appear to be working properly but I want to
get rid of these warnings. Any ideas?
errors of the form
xyz.cpp(nnn): warning C4273: '<somefunction>' : inconsistent dll linkage
I have other DLLs that have been created using the same basic pattern. I
using the approach where the following code appears in the .h file:
#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif
Each of the functions in the .h file are prefixed with this macro:
MYDLL_API unsigned int myfunc();
The DLL project defines the MYDLL_EXPORTS symbol so that the specified
functions are exported. Conversely, any app that includes this .h file will
not have the macro defined and will use the dllimport directive.
So, this is my basic approach to creating my DLLs. In a couple of cases I'm
getting these warning messages. I'm obviously missing something obvious but
I can't figure it out. The DLLs appear to be working properly but I want to
get rid of these warnings. Any ideas?