Thanks for replying.
below is my cMakeList.txt I don't understand it much.
Also, I added MAKE_FLAGS+=VERBOSE=1 but I don't see anything different.
where should I add what?
below is CMakelist.txt from the example code I am editing(/examples/heart_rate_collector). and also added Makefile of the package.
cmake_minimum_required(VERSION 3.3)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} $ENV{TARGET_LDFLAGS} -L$ENV{BUILD_DIR} -Wl,--rpath-link,$ENV{STAGING_DIR}/lib")
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} $ENV{TARGET_LDFLAGS} -Wl,--rpath-link,/home/lyx/workspace/openwrt/openwrt_thingoo/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lib")
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/home/lyx/workspace/openwrt/pc-ble-driver-master-widora -Wl,--rpath-link,/home/lyx/workspace/openwrt/openwrt_widora-master/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lib ")
# Use multithreaded Boost libraries
set(Boost_USE_MULTITHREADED ON)
# Use static boost libraries so the dynamic library
# can run anywhere
set(Boost_USE_STATIC_LIBS ON)
# Find the necessary boost components on the system.
# Minimum version required is 1.54.0
find_package ( Boost 1.54.0 REQUIRED COMPONENTS thread system regex date_time chrono )
link_directories (
../../build
)
include_directories (
../../include/common/sdk_compat
../../include/common
../../include/common/internal/transport
)
if(MSVC)
add_definitions(-DPC_BLE_DRIVER_STATIC)
endif()
# Build executable
add_executable(hrc_v2 main.c)
add_executable(hrc_v3 main.c)
target_compile_definitions(hrc_v2 PRIVATE -DNRF_SD_BLE_API=2)
target_compile_definitions(hrc_v3 PRIVATE -DNRF_SD_BLE_API=3)
target_include_directories(hrc_v2 PRIVATE ../../src/sd_api_v2/sdk/components/softdevice/s132/headers)
target_include_directories(hrc_v3 PRIVATE ../../src/sd_api_v3/sdk/components/softdevice/s132/headers)
# Specify libraries to link with
if(MSVC)
target_link_libraries(hrc_v3 PRIVATE pc_ble_driver_static_sd_api_v3)
target_link_libraries(hrc_v2 PRIVATE pc_ble_driver_static_sd_api_v2)
else()
target_link_libraries(hrc_v2 PRIVATE pc_ble_driver_shared_sd_api_v2)
target_link_libraries(hrc_v3 PRIVATE pc_ble_driver_shared_sd_api_v3)
endif()
target_link_libraries(hrc_v2 PRIVATE ${Boost_LIBRARIES})
target_link_libraries(hrc_v3 PRIVATE ${Boost_LIBRARIES})
Add the VERBOSE=1 flag here to each $(MAKE) invocation.
Rebuild and it should reveal the link command. From there hopefully we will know for sure whether the library search path is correct and -lcurl is present.
As for the CMakeLists.txt, I do not see any mention of curl there. You will need to figure that out
define Build/Compile
$(MAKE) -C $(MAKE_FLAGS) $(PKG_BUILD_DIR)
$(MAKE) -C $(MAKE_FLAGS) $(PKG_BUILD_DIR)/examples/heart_rate_monitor
$(MAKE) -C $(MAKE_FLAGS) $(PKG_BUILD_DIR)/examples/heart_rate_collector
endef
compilation ends with error and some more details of command
Looks like it's not just libcurl, possibly libssl and libcrypto from openssl are also part of this. You will need to edit CMakeLists.txt files to let it know that the target program depends on these libraries.
Yes, I have selected OpenSSL inside libcurl config in menuconfig.
I have no idea of cMakelists.txt that's the problem. If I had so much of knowledge I would have done it by now
I worked out to find a solution to my problem from yesterday but could not work out.
I have a timeline of Wednesday to finish implementing few https APIs. I have a workaround of calling python3 from C. I have noticed python3 is too slow on the hardware and openwrt. even after precompiling python modules.
I added the following lines in the CMakelists.txt and that removed the undefined error for libcurl.
But still with openSSL though openSSL is also in the same path.
I also tried -lopenssl or find_package( openssl ) but that gave some strange errors related to BOOST.