FreeOpcUa / freeopcua

Open Source C++ OPC-UA Server and Client Library
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
712 stars 340 forks source link

Freeopcua on Windows 10 and vs2013 #317

Open Lizard00 opened 6 years ago

Lizard00 commented 6 years ago

Hello to all, I have a big problem to get freeopcua working on a Windows 10 with Visual Studio 2013. I hope you will find my fault and could help me.

My installation steps:

  1. Download and install Boost (boost_1_56_0-msvc-12.0-32.exe)
  2. Download and make freepocua with CMake 3.9.0-rc1 Cmake Configure output:

The C compiler identification is MSVC 18.0.31101.0 The CXX compiler identification is MSVC 18.0.31101.0 Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done Looking for pthread.h Looking for pthread.h - not found Found Threads: TRUE
Boost version: 1.56.0 Found the following Boost libraries: system program_options filesystem thread chrono date_time atomic Boost INCLUDE DIR IS: C:/local/boost_1_56_0 Boost LIBRARY DIR IS: C:/local/boost_1_56_0/lib32-msvc-12.0 SSL support using libmbedtls: ON mbedtls LIBRARIES: mbedx509mbedtlsmbedcrypto Found PythonLibs: C:/Users/User1/.platformio/python27/libs/python27.lib (found version "2.7.14") Compiling module for python 2.7.14 Boost version: 1.56.0 Found the following Boost libraries: python Configuring done ``

Cmake generating output:

Boost version: 1.56.0 Found the following Boost libraries: system program_options filesystem thread chrono date_time atomic Boost INCLUDE DIR IS: C:/local/boost_1_56_0 Boost LIBRARY DIR IS: C:/local/boost_1_56_0/lib32-msvc-12.0 SSL support using libmbedtls: ON mbedtls LIBRARIES: mbedx509mbedtlsmbedcrypto Compiling module for python 2.7.14 Boost version: 1.56.0 Found the following Boost libraries: python Configuring done

  1. Open freeopcua.sln in Visual Studio 2013 and build the solution. But I get some linking and compiler errors and I don’t know how to resolve them. Where did I made a fault?

Error 76 error LNK2019: unresolved external symbol "public: void thiscall OpcUa::Binary::DataDeserializer::Deserialize<class std::vector<struct OpcUa::ExtensionObject,class std::allocator > >(class std::vector<struct OpcUa::ExtensionObject,class std::allocator > &)" (??$Deserialize@V?$vector@UExtensionObject@OpcUa@@V?$allocator@UExtensionObject@OpcUa@@@std@@@std@@@DataDeserializer@Binary@OpcUa@@QAEXAAV?$vector@UExtensionObject@OpcUa@@V?$allocator@UExtensionObject@OpcUa@@@std@@@std@@@Z) referenced in function "public: class OpcUa::Binary::DataDeserializer & thiscall OpcUa::Binary::DataDeserializer::operator>><class std::vector<struct OpcUa::ExtensionObject,class std::allocator > >(class std::vector<struct OpcUa::ExtensionObject,class std::allocator > &)" (??$?5V?$vector@UExtensionObject@OpcUa@@V?$allocator@UExtensionObject@OpcUa@@@std@@@std@@@DataDeserializer@Binary@OpcUa@@QAEAAV012@AAV?$vector@UExtensionObject@OpcUa@@V?$allocator@UExtensionObject@OpcUa@@@std@@@std@@@Z) C:\Users\User1\Downloads\freeopcua-master\buildDir\binary_variant.obj opcuaprotocol Error 77 error LNK1120: 1 unresolved externals C:\Users\User1\Downloads\freeopcua-master\buildDir\bin\Debug\opcuaprotocol.dll opcuaprotocol Error 80 error C2511: 'void Common::Uri::Initialize(const char *,size_t)' : overloaded member function not found in 'Common::Uri' C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 23 1 opcuacore Error 81 error C2597: illegal reference to non-static member 'Common::Uri::SchemeStr' C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 40 1 opcuacore Error 82 error C2597: illegal reference to non-static member 'Common::Uri::UserStr' C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 41 1 opcuacore Error 83 error C2597: illegal reference to non-static member 'Common::Uri::PasswordStr' C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 42 1 opcuacore Error 84 error C2597: illegal reference to non-static member 'Common::Uri::HostStr' C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 43 1 opcuacore Error 85 error C2597: illegal reference to non-static member 'Common::Uri::PortNum' C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 44 1 opcuacore Error 86 error C2228: left of '.empty' must have class/struct/union C:\Users\User1\Downloads\freeopcua-master\src\core\common\uri_facade_win.cpp 46 1 opcuacore Error 147 error LNK1104: cannot open file 'lib\Debug\opcuacore.lib' C:\Users\User1\Downloads\freeopcua-master\buildDir\LINK opcuaclientapp Error 154 error C1083: Cannot open include file: 'mbedtls/entropy.h': No such file or directory C:\Users\User1\Downloads\freeopcua-master\src\client\client.cpp 29 1 opcuaclient Error 166 error LNK1104: cannot open file 'lib\Debug\opcuaclient.lib' C:\Users\User1\Downloads\freeopcua-master\buildDir\LINK example_client Error 202 error C2065: 'SHUT_RDWR' : undeclared identifier C:\Users\User1\Downloads\freeopcua-master\src\server\tcp_server.cpp 181 1 opcuaserver Error 278 error LNK1104: cannot open file 'lib\Debug\opcuaserver.lib' C:\Users\User1\Downloads\freeopcua-master\buildDir\LINK example_server Error 288 error LNK1104: cannot open file 'lib\Debug\opcuaserver.lib' C:\Users\User1\Downloads\freeopcua-master\buildDir\LINK opcuaserverapp Error 346 error C2061: syntax error : identifier 'uint' C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 245 1 opcua Error 347 error C2065: 'period' : undeclared identifier C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 247 1 opcua Error 348 error C2065: 'callback' : undeclared identifier C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 247 1 opcua Error 349 error C2061: syntax error : identifier 'uint' C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 259 1 opcua Error 350 error C2065: 'period' : undeclared identifier C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 261 1 opcua Error 351 error C2065: 'callback' : undeclared identifier C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 261 1 opcua Error 352 error C3083: '{ctor}': the symbol to the left of a '::' must be a type C:\Users\User1\Downloads\freeopcua-master\python\src\py_opcua_module.cpp 298 1 opcua

adamThornton commented 5 years ago

I'm getting a similar linking error with building in Win 7 and VS 2013...

cenit commented 5 years ago

using vcpkg it should be possible to install freeopcua on windows and also mac/linux starting from sources, together with the most up-to-date boost libs. Please let me know if it works for you or any problem you may have, together we can fix it if there's any problem.

valeria2706 commented 4 years ago

using vcpkg it should be possible to install freeopcua on windows and also mac/linux starting from sources, together with the most up-to-date boost libs. Please let me know if it works for you or any problem you may have, together we can fix it if there's any problem.

Hi, I have installed freeopcua through vcpkg and did "vcpkg integrate install" but the problem is not solved. Can you help me with this?

cenit commented 4 years ago

which problem? this issue was related to the process of building freeopcua itself, if you installed it through vcpkg it should have been built properly.

valeria2706 commented 4 years ago

which problem? this issue was related to the process of building freeopcua itself, if you installed it through vcpkg it should have been built properly. This time I git cloned a new freeopcua and directly open the folder with VS. However when I try to run the example_server.exe, there is still some errors in building. As in the pic: image

cenit commented 4 years ago

it might be possible that the current master branch is broken on windows. I can guarantee the result only if you use vcpkg with tested release (just do ./vcpkg install freeopcua:x64-windows)

cenit commented 4 years ago

if you really need the latest version from head of master here, and you need to build it on windows, it might require a patch. Sorry I don't have time at the moment to work on it, so I cannot guarantee anything. One idea might be to request an update on the vcpkg issue tracker. Then maybe someone might take the burden of testing it and producing the patches.

valeria2706 commented 4 years ago

Anyways Thanks for your reply. I will check what I can do more about this issue

mustafa-erduran commented 3 years ago

Hi, I don't want to use vcpkg because i need source code to make change them.But i get tons of errors. Why am i get insteresting errors, is there anyone can help me this stituation. Btw i installed boost and libxml.