open62541 / open62541

Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0
http://open62541.org
Mozilla Public License 2.0
2.59k stars 1.24k forks source link

[1.3] Can not run simple server demo in windows10 with vs2022 #5829

Open CHN-STUDENT opened 1 year ago

CHN-STUDENT commented 1 year ago

Description

I use cmake3.26.4 (with-gui) to generating vs solution, then open it in windows10 with vs2022, and create a open62541.lib, but i follow the doc how can building a simple server, i get some error. Could you give me some advice? I also add include folder, plugins\include folder and open62541.lib to my vs project.

image image

CMake Ouput:

Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
The C compiler identification is MSVC 19.36.32532.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Found Python3: D:/Python311/python.exe (found version "3.11.4") found components:  Interpreter 
Could NOT find Git (missing: GIT_EXECUTABLE) 
Could NOT find Git (missing: GIT_EXECUTABLE) 
CMake Warning at tools/cmake/SetGitBasedVersion.cmake:23 (message):
  Failed to determine the version from git information.  Using defaults.
Call Stack (most recent call first):
  CMakeLists.txt:51 (set_open62541_version)

open62541 Version: v1.2.2-unknown
CMAKE_BUILD_TYPE not given; setting to 'Debug'
The selected architecture is: win32
Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
Could NOT find LATEX (missing: LATEX_COMPILER) 
Configuring done (7.2s)
Generating done (0.3s)

Background Information / Reproduction Steps

Used CMake options:

cmake -DUA_NAMESPACE_ZERO=<YOUR_OPTION> <ANY_OTHER_OPTIONS> ..

Checklist

Please provide the following information:

r-sin commented 1 year ago

Try enabling UA_BUILD_EXAMPLES in CMake then configure/generate. In VS select one of the examples/tutorials als Startup Project and press F5. At least this should work, or there is realy a problem.

CHN-STUDENT commented 1 year ago

@r-sin Thanks for your advice, but it sames not work me, i get some error too.

image