1
Vote

Build error on x64 platform.

description

Hi,

I'm trying out LibOPC and was trying to build it on x64 in VS 2015 on Windows.
I get the following error in plib.h -

#error: "configure not executed and we are not on a win32 machine? please run configure or define WIN32 is you are on a WIN32 platform."

Do I need to run configure script on Windows as well?

comments

jschroedl wrote Feb 24 at 4:26 PM

Our product's 64-bit and 32-bit Windows builds always have WIN32 as one of the preprocessor directives. This is necessary for other definitions such as the Windows SDK AIUI.

vmittal wrote Feb 24 at 9:01 PM

Thanks for the reply @jjschroedl. After adding the preprocessor directive for WIN32, I am getting Linker warnings and errors.

Warning LNK4272 library machine type 'X86' conflicts with target machine type 'x64'

This warning comes for all libs - mce.lib, opc.lib, xml.lib, zlib.lib

jschroedl wrote Feb 27 at 1:18 PM

It sounds like your x64 configuration is still not setup properly. Go to Build > Configuration Manager. Then in the combobox at the top, select Debug or Release (whichever you're trying) and x64. Look at the list below and make sure mce, opc, xml, and zlib are set to x64 for that configuration. Now switch Debug/Release to the other and check there too. You may need to switch the Platform to x64 for those libraries.