freeopcua icon indicating copy to clipboard operation
freeopcua copied to clipboard

Build under windows fails

Open cedricboudinet opened this issue 10 years ago • 7 comments

Hi

I tried to compile freeopcu under windows 7 with cmake 3.4.1 and Visual Studio 2013.

I launch : mkdir build.msvc12.cmd cd build.msvc12.cmd cmake .. -DBOOST_ROOT=C:\boost_1_59_0 -DBOOST_LIBRARYDIR=c:\boost_1_59_0\lib32-msvc-12.0 cmake --build .

It fails on that step : C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:QU EUE /OUT:"F:\Boudinet\Apps\freeopcua\build.msvc12.cmd\bin\Debug\opcuacore.dll " /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32 .lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib Wininet.lib ws ock32.lib lib\Debug\opcuaprotocol.lib Wininet.lib wsock32.lib /MANIFEST /MANI FESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"F:/ Boudinet/Apps/freeopcua/build.msvc12.cmd/bin/Debug/opcuacore.pdb" /SUBSYSTEM: CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"F:/Boudinet/Apps/freeopcua/b uild.msvc12.cmd/lib/Debug/opcuacore.lib" /MACHINE:X86 /SAFESEH /machine:X86

with the message: LINK : fatal error LNK1104: cannot open file 'lib\Debug\opcuaprotocol.lib' [F:
Boudinet\Apps\freeopcua\build.msvc12.cmd\opcuacore.vcxproj]

Library bin\Debug\opcuacore.dll exists. It seems that it has been built in place of lib\Debug\opcuaprotocol.lib. How to force msvc to generate all the .lib files automatically ?

cedricboudinet avatar Dec 14 '15 17:12 cedricboudinet

Hello, I have exactly the same problem (exception made for the version of Visual Studio, I've the 2015 one), if someone could help I'd be grateful.

Zorze93 avatar Dec 15 '15 20:12 Zorze93

Hello, This issue can be solved by changing "Configuration Type" from Dyanamic Library (.dll) to lib, and copy libs to \lib directory

KnightChang17 avatar Dec 27 '15 13:12 KnightChang17

Hi, Same problem for me on Visual Studio 2013. Can I get any hints on how to change the configuration type?

marcassin22 avatar Jun 10 '16 12:06 marcassin22

Can I get any hints on how to change the configuration type?

Do not select BUILD_SHARED_LIBS in CMake GUI or run cmake with -DBUILD_SHARED_LIBS=off.

tbeu avatar Sep 16 '16 12:09 tbeu

The real problem with the missing import libraries (LIB) when building shared libraries (DLL) using MSVC is that there are no exported symbols at all in the shared libraries (DLL). For that reason there are no import libraries (LIB) built. Thus it really is bug in the Win build configuration.

tbeu avatar Sep 22 '16 07:09 tbeu

@tbeu can you make PR with correct configuration?

destogl avatar Sep 26 '16 13:09 destogl

Sorry, I am not a CMake expert.

tbeu avatar Sep 26 '16 13:09 tbeu