Boost Serialisation Library Linking Error

Hi Support,
I am trying to use Boost’s serialisation library with an AXCF3152 2023.0 PLC. Out of the box, some boost libraries seem to work by default (for example, we have used basic types like boost::optional and more complicated libraries such as boost::statechart without issue). However, the serialisation library cannot be linked against at build time, with errors such as:
[cmake]: :(.text+0xfc): undefined reference to boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::text_oarchive_impl(std::ostream&, unsigned int)'**__**[cmake]: /opt/plcnext_axcf2152_sdk_2023/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/11.3.0/real-ld: <redacted>:(.text+0x10c): undefined reference to boost::archive::detail::basic_oarchive::~basic_oarchive()'[cmake]: /opt/plcnext_axcf2152_sdk_2023/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-pxc-linux-gnueabi/gcc/arm-pxc-linux-gnueabi/11.3.0/real-ld: :(.text+0x112): undefined reference to `boost::archive::basic_text_oprimitivestd::ostream::~basic_text_oprimitive()'__[cmake]: collect2: error: ld returned 1 exit status
Is there something I can add to include support for additional boost libraries (namely serialisation)? This is somewhat strange, as under the toolchain, the shared object files exist at the path:
sysroots/corei7-64-pxc-linux/usr/lib/libboost_serialization.so
This is a different root directory to the one above (i.e. plcnext_axcf3152_sdk_2023/sysroots/corei7-64-pxc-linux VS plcnext_axcf3152_sdk_2023/sysroots/x86_64-pokysdk-linux), but I’m not sure why the 3152 has two toolchain directories for x86 processors. With the AXCF2152 toolchain, the .so file also exists in the one directory it has for ARM (plcnext_axcf2152_sdk_2023/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi/usr/lib/libboost_*).
Appreciate your help with this.
Kind Regards,
Joshua

the shared object files exist at the path:sysroots/corei7-64-pxc-linux/usr/lib/libboost_serialization.soThis is a different root directory to the one above (i.e. plcnext_axcf3152_sdk_2023/sysroots/corei7-64-pxc-linux VS plcnext_axcf3152_sdk_2023/sysroots/x86_64-pokysdk-linux), but I’m not sure why the 3152 has two toolchain directories for x86 processors.One of the sysroots sub-directories is for the target platform, and the other is for the host platform.
For example:
AXC F 3152 SDK on Linux:

                              * Target: corei7-64
                              * Host: x86_64 (linux)
                              * AXC F 2152 SDK on Windows:  

Target: cortexa9t2hf-neon
* Host: x86_64 (Win64)
The host directory contains the build tools that run on the host platform, like gcc and ld.
The Target directory contains the binaries for the target platform, like shared object libraries, and the corresponding header files.

the shared object files exist at the path:
sysroots/corei7-64-pxc-linux/usr/lib/libboost_serialization.so

With the AXCF2152 toolchain, the .so file also exists in the one directory it has for ARM (plcnext_axcf2152_sdk_2023/sysroots/cortexa9t2hf-neon-pxc-linux-gnueabi/usr/lib/libboost_*).
These directories contain the binaries for the corresponding target , so this makes sense - the first is the sysroots directory for the AXC F 3152 target, and the second is the sysroots directory for the AXC F 2152 target.

the serialisation library cannot be linked against at build time …
Is there something I can add to include support for additional boost libraries (namely serialisation)?
I will check this and get back to you.

Please try adding boost_serialization to the list of target_link_libraries in the project’s CMakeLists.txt file.

Amazing, works like a charm. Thanks a lot for your help Martin!