Linker error when using async publisher (community version)

2 posts / 0 new
Last post
Last seen: 2 years 10 months ago
Joined: 09/17/2015
Posts: 53
Linker error when using async publisher (community version)

Hello all,

I'm trying to use an async publisher as described in:

My application runs fine with all dds features as long as I am not using the async publisher, but when adding the following line:

topic_qos << rti::core::policy::PublishMode::Asynchronous();

I get the following linker error:

undefined reference to `rti::core::policy::PublishMode& rti::topic::qos::TopicQosImpl::policy()'

Is this feature not available in community the community version?

Best regards


Last seen: 2 days 8 hours ago
Joined: 04/02/2013
Posts: 140

Hi Andreas,

TopicQos only contains policies that are common to the DataWriter and DataReader.

Since Asynchronous publisher only applies to DataWriters, you can only set it in DataWriterQos.

You can still start from your topic qos. For example:

dds::pub::qos::DataWriterQos writer_qos = topic_qos; // Create a DataWriterQos with the initial values specified in a TopicQos
writer_qos << rti::core::policy::PublishMode::Asynchronous();  

Then create your DataWriter using writer_qos instead of topic_qos.