Hi !
This error happens when the linker is unsure what it should do with a
symbol. To export/import it or not. You should make sure that at the
beginning of the header file, you have a comment #pragma once written. This
makes sure that each function declaration is done only once, no matter how
many compilation units (.cpp files) include the header.
For example, this will cause the error
__declspec(dllexport) int MyFunc();
__declspec(dllimport) int MyFunc(); // Inconsistent DLL linkage
-Antti Keskinen
> I've created an unmanaged C++ DLL and when I compile it I get numerous
> errors of the form
[quoted text clipped - 22 lines]
> 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?
Peter Steele - 07 Feb 2005 15:23 GMT
This doesn't seem to be the cause in this case. I get these warnings when I
compile the DLL itself, not when I link it with other apps. The DLL of
course only includes its own .h file one time so there is no chance two
declspec directuves are being compiled, or at least I don't see how...
> Hi !
>
[quoted text clipped - 36 lines]
>> 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?