@Josaphat_Aviles ,
There is a lot to unpack here. Unfortunately, I can't write the app for you.
I'd suggest learning more about cmake and snapcraft. Some of the other cpp examples have more complex cmake and snapcraft files. For instance, the simple datalayer client example. Also, when building for arm64 architecture on an amd system, it is important to understand cross compiling and snapcraft package staging.
Here are a couple code snippets that might help in building your app. I just integrated libcurl into a c++ application and built on amd for arm.
In CMakeLists.txt, it is necessary to locate and link your additional libraries. You can install libraries on Ubuntu amd for arm, but it is a bit complicated and will likely require some troubleshooting.
# Locate libcurl based on architecture
IF( ${CMAKE_BUILD_KIT} MATCHES "aarch64")
find_library(CURL NAMES curl PATHS /usr/lib/aarch64-linux-gnu NO_DEFAULT_PATH)
ELSE()
find_library(CURL NAMES curl)
ENDIF()
#
# Set target link libraries
#
target_link_libraries(${TARGET_PROJECT_NAME} -Wl,--no-undefined)
target_link_libraries(${TARGET_PROJECT_NAME}
libcomm_datalayer.so
pthread
systemd
zmq
ssl
crypto
${CURL}
)
In your snapcraft.yaml, it is necessary to stage the additional packages so they can be utilized by the snap at runtime.
parts:
datalayerclient:
plugin: dump
source: ./generated/build
stage-packages:
- libzmq5
- ctrlx-datalayer
- libcurl4
If you can provide some more specific questions, I can give you some better answers.
... View more