All Products
Search
Document Center

:Porting Overview

Last Updated:Jan 26, 2019

Compile SDKs

Link Kit SDK for C language needs to be compiled before running, the SDK is usually compiled in the following two ways:

Compiled by make/cmake

For advanced systems like Linux or Windows, you can use make/cmake to compile the SDK.

This compilation method will generate libiot_hal.a and libiot_sdk.a, then users can link them to their applications. If an application uses MQTT+TLS to connect to the Internet of Things (IoT) platform, or it will use device local control or WiFi provision, the application must also link libiot_tls.a.

Currently, the build and configuration system of the device C-SDK supports the following compilation methods:


  • Compile with GNU Make + various tool chains on Linux to generate an SDK for various embedded target architectures

    • GNU Make + GCC generates an SDK for 64-bit Linux and executable processes
    • GNU Make + GCC generates an SDK for 32-bit Linux and executable processes
    • GNU Make + i686-w64-mingw32-gcc generates an SDK for Windows platforms and executable processes
    • GNU Make + arm-none-eabi-gcc generates an SDK for MK3060/MK3080 embedded platforms
    • GNU Make + xtensa-lx106-elf-gcc generates an SDK for ESP8266 embedded platforms
    • GNU Make + arm-linux-gnueabihf-gcc generates an SDK for arm-linux embedded platforms
  • Compile with CMake + various tool chains on Linux to generate an SDK for various target architectures

    • CMake + GCC generates an SDK for 64-bit Linux
    • CMake + GCC generates an SDK for 32-bit Linux
    • CMake + arm-linux-gnueabihf-gcc generates an SDK for arm-linux embedded platforms
    • CMake + i686-w64-mingw32-gcc generates an SDK for Windows platforms
  • Compile with VS Code 2015 on Windows to generate an SDK for Windows platforms

Compiled by IDE by adding SDK source code into the IDE

For some embedded systems, Make/CMake cannot be used. In this case, developers need to add the SDK source code to the IDE (such as KEIL/IAR) and then compile the code.

SDK Customization

  • Link Kit SDK provides a customization tool for systems that support Make, Users can enable or disable certain functions through ‘make menuconfig’, only enabled components will be compiled.
  • For systems that do not support Make, users can add the source code files of needed components into the IDE, and then compile them.

Using the SDK

When calling the APIs provided by SDK, the user’s program needs to include the following two header files:

  1. #include "iot_import.h"
  2. #include "iot_export.h"