I want build Psdk in RaspberryPI 4B, and use c++.
this is sdk I used: https://github.com/dji-sdk/Payload-SDK
this is my folder:
manifold2
|
|--application/
|--build/
|--hal/
|--CMakeList.txt
I try building
cd build
cmake ..
make
In my c code I have use extern "C":
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
//User can config dev based on there environmental conditions
#define LINUX_UART_DEV1 "/dev/ttyS0"
#define LINUX_UART_DEV2 "/dev/ttyACM0"
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
T_DjiReturnCode HalUart_Init(E_DjiHalUartNum uartNum, uint32_t baudRate, T_DjiUartHandle *uartHandle);
T_DjiReturnCode HalUart_DeInit(T_DjiUartHandle uartHandle);
T_DjiReturnCode HalUart_WriteData(T_DjiUartHandle uartHandle, const uint8_t *buf, uint32_t len, uint32_t *realLen);
T_DjiReturnCode HalUart_ReadData(T_DjiUartHandle uartHandle, uint8_t *buf, uint32_t len, uint32_t *realLen);
T_DjiReturnCode HalUart_GetStatus(E_DjiHalUartNum uartNum, T_DjiUartStatus *status);
#ifdef __cplusplus
}
#endif
below is my output error:
....
-- - Libraries: /usr/lib/aarch64-linux-gnu/libavcodec.so;/usr/lib/aarch64-linux-gnu/libavformat.so;/usr/lib/aarch64-linux-gnu/libavutil.so;/usr/lib/aarch64-linux-gnu/libswscale.so;/usr/lib/aarch64-linux-gnu/libz.so
-- - Version: 4.3.5-0+deb11u1+rpt3
-- Cannot Find OPUS
-- Cannot Find LIBUSB
-- Configuring done
-- Generating done
-- Build files have been written to: /home/danny/Desktop/payload_master/Payload-SDK/samples/sample_c++/platform/linux/manifold2/build
/usr/bin/ld: CMakeFiles/dji_sdk_demo_linux_cxx.dir/application/application.cpp.o: in function `Application::Application(int, char**)':
application.cpp:(.text+0x5c): undefined reference to `Osal_TaskSleepMs'
/usr/bin/ld: CMakeFiles/dji_sdk_demo_linux_cxx.dir/application/application.cpp.o: in function `Application::DjiUser_SetupEnvironment()':
application.cpp:(.text+0xcc): undefined reference to `HalNetWork_Init'
/usr/bin/ld: application.cpp:(.text+0xd0): undefined reference to `HalNetWork_Init'
/usr/bin/ld: application.cpp:(.text+0xd8): undefined reference to `HalNetWork_DeInit'
/usr/bin/ld: application.cpp:(.text+0xdc): undefined reference to `HalNetWork_DeInit'
/usr/bin/ld: application.cpp:(.text+0xe4): undefined reference to `HalNetWork_GetDeviceInfo'
/usr/bin/ld: application.cpp:(.text+0xe8): undefined reference to `HalNetWork_GetDeviceInfo'
/usr/bin/ld: application.cpp:(.text+0xf0): undefined reference to `Osal_Socket'
/usr/bin/ld: application.cpp:(.text+0xf4): undefined reference to `Osal_Socket'
/usr/bin/ld: application.cpp:(.text+0xfc): undefined reference to `Osal_Bind'
/usr/bin/ld: application.cpp:(.text+0x100): undefined reference to `Osal_Bind'
/usr/bin/ld: application.cpp:(.text+0x108): undefined reference to `Osal_Close'
/usr/bin/ld: application.cpp:(.text+0x10c): undefined reference to `Osal_Close'
/usr/bin/ld: application.cpp:(.text+0x114): undefined reference to `Osal_UdpSendData'
/usr/bin/ld: application.cpp:(.text+0x118): undefined reference to `Osal_UdpSendData'
/usr/bin/ld: application.cpp:(.text+0x120): undefined reference to `Osal_UdpRecvData'
....
but I try using c, I can build success. how can I fix? is fix CMakeList.txt? or more