Trying to build pub/sub examples

230 views
Skip to first unread message

Andrew Crosland

unread,
Oct 12, 2018, 6:01:19 AM10/12/18
to open62541
Hi,

I tried to build the pub/sub examples from the github master branch

I have built the amalgamated .c/.h and manually enabled the PUBSUB #defines in the .h

When I try to make the example there are multiple undefined types:

build $ gcc -std=c99 open62541.c tutorial_pubsub_publish.c -o tutorial_pubsub_publish
In file included from open62541.c:28:0:
open62541.h:23231:5: error: unknown type name 'UA_KeyValuePair'
     UA_KeyValuePair *connectionProperties;
     ^
open62541.h:23272:5: error: unknown type name 'UA_DataSetMetaDataType'
     UA_DataSetMetaDataType metaData;
     ^
open62541.h:23274:5: error: unknown type name 'UA_PublishedVariableDataType'
     UA_PublishedVariableDataType *variablesToAdd;
     ^
open62541.h:23283:5: error: unknown type name 'UA_DataSetMetaDataType'
     UA_DataSetMetaDataType metaData;
     ^

etc., ...


I cannot find relevant typedefs anywhere in the source files, so I do not think it is a problem with the way the amalgamated files are built.

Should it be possible to build the examples from the current master branch?

Regards,

Andrew

Julius Pfrommer

unread,
Oct 22, 2018, 12:23:25 PM10/22/18
to open62541
Please use cmake to rebuild your project or the amalgamation.
PubSub uses custom datatypes that are only generated for the amalgamation if the feature is enabled in cmake.

Andrew Crosland

unread,
Oct 23, 2018, 3:48:58 AM10/23/18
to open62541
I did use cmake/ccmake but I do not see any option for pubsub or custom data types.

Which option(s) do I need to enable?

Andrew

Andrew Crosland

unread,
Oct 23, 2018, 4:04:00 AM10/23/18
to open62541
Ah, I found the advanced mode in ccmake :)
Reply all
Reply to author
Forward
0 new messages