Hi,
I am working on a dll that exports COM interfaces, and i am having some
troubles with the use of precompiled headers.
the project compiles always, but if i use /Yu (default: use precompiled
header) i get linker error:
OPCServer.exp : warning LNK4070: /OUT:OPCServer.dll directive in .EXP
differs from output filename '.\Debug/CIT_OPC_Server.dll'; ignoring
directive
OPCServer.obj : error LNK2001: unresolved external symbol
_CLSID_CITOPCServer
I can build without problems if i use /Yx (automatically create precompiled
headers) (strange) or
if i don't use precompiled headers at all.
the problem probably lies in the main cpp file:
#define INITGUID // WITHOUT THIS WE WON'T SEE CLSID_CITOPCServer
#include "stdafx.h"
#include "_OPCServer_.h"
#include "OPCDEFS.h"
#include "GlobalDef.h"
#include "process.h"
#include "opc10.h"
it looks as if #define INITGUID is not visible anymore by the code that is
_OPCServer_.h, because if i compile without precompiled headers, and i
comment that define away, i get the same linker error.
i have tried switching the lines #define INITGUID and #include "stdafx.h"
but that didn't help.
does anyone know the cause of this strange behavior?
kind regards,
Bruno.