0

I trying to go into the open62541 project to use it in my solution. My platform is windows.

At first, I downloaded the release files (open62541.h/c) and compiled the server example with GCC compiler (MinGW64).

$ gcc -std=c99 open62541.c myServer.c -l"ws2_32" -o myServer

That works. So my following step was to get the newest master from GitHub, and build it with CMAKE. I used the following CMAKE configuration:

CMAKE configuration

UA_NAMESPACE_ZERO Reduced is used due to FULL will cause CAMKE to fail generate project:

CMake Error at CMakeLists.txt:1156 (message): File C:/Users/lukasz/Desktop/open62541-visual/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml not found. You probably need to initialize the git submodule for deps/ua-nodeset or set open62541_NODESET_DIR.

That will create a .sln, and simple build all creates open62541.h/c. When I try to compile the example with generated files I got this error:

> $ gcc -std=c99 open62541.c myServer.c -l"ws2_32" -o myServer
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccs27GQ8.o:myServer.c:(.text+0xa3): undefined reference
> to `__imp_UA_ServerConfig_setMinimalCustomBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccs27GQ8.o:myServer.c:(.text+0xe3): undefined reference
> to `__imp_UA_Log_Stdout'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccs27GQ8.o:myServer.c:(.text+0x13e): undefined reference
> to `__imp_UA_Server_new'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccs27GQ8.o:myServer.c:(.text+0x152): undefined reference
> to `__imp_UA_Server_getConfig'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccs27GQ8.o:myServer.c:(.text+0x171): undefined reference
> to `__imp_UA_Server_run'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:\msys64\tmp\ccs27GQ8.o:myServer.c:(.text+0x184): undefined reference
> to `__imp_UA_Server_delete' collect2.exe: error: ld returned 1 exit
> status

What causes that difference to released files?

  • Have you tried to do what the message "You probably need to initialize the git submodule for deps/ua-nodeset" tolds you? https://stackoverflow.com/questions/1030169/easy-way-to-pull-latest-of-all-git-submodules – Tsyvarev Oct 24 '21 at 16:51
  • Thanks, that resolve the issue with UA_NAMESPACE_ZERO which now accepts value FULL. But the results of the compilation are the same. – L Kwiatkowski Oct 25 '21 at 15:35
  • Building just open62541 library - not whole sln (sometimes it needs to be done twice), and compilation >gcc -std=c99 open62541.c myServer.c -l"ws2_32" -o myServer resolve the issue. – L Kwiatkowski Nov 01 '21 at 10:25

0 Answers0