Treating as Server code:
- I have created an shared library,which contains nanomsg package functionality.
- Adding
DEPENDS += "nanomsg"
in bb file. (Without this<nanomsg/*.h>
gives "no such file are directory" errors). - Server will send some data to client via shared library(using nanomsg IPC).
Treating as Stand alone application code:
Application code calls the shared lib functionality, such that recieves data from server.
Uses
target_link_libraries
for the shared library and include directories.while using bitbake
.. undefined reference 'nn_send' ... nn_socket ld: exit 1 status issues are
seen.
Please help me on this.
CMakeList.txt
:
nanomsg code path in project dir:
include_directories(${XXXXX_SRC}thirdparty/nanomsg/src)
shared lib created in other project dir:
include_directories(${CMAKE_SOURCE_DIR}/xxxxx)
Test app name - nn_client:
3.
set(
COMPONENT_EXECUTABLE_NN_CLI
"nn_client"
)
Linking the shared lib with my source file
4.
target_link_libraries(${COMPONENT_EXECUTABLE_NN_CLI}
ptpnnmsg
${EXTRA_LIBS}
)
Since above one is not working added below one as an addon - where sharednnmsg located.
target_link_libraries(${COMPONENT_EXECUTABLE_NN_CLI} -L/../../../xxx/)
-
install(TARGETS ${COMPONENT_EXECUTABLE_NN_CLI} DESTINATION ${CMAKE_INSTALL_BINDIR})
Instead of point-6 as above tried as
install(TARGETS nn_client
RUNTIME DESTINATION bin
)
errors while doing bitbake:
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_recv'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_freemsg'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_bind'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_shutdown'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_send'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_connect'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_socket'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_strerror'
../../../../xxxx/libptpnnmsg.so: undefined reference to `nn_errno'