link C libraries in omega2



  • Below is a paragraph mentioned on the onion website page : Compiling C on the Omega

    Library Header Availability

    When the Omega’s OS is built, the header files for libraries that are not regularly part of the C standard library are not included as a space saving measure. If you take a look at /usr/lib, where the library shared object are kept and compare it to /usr/include, where the library header files are kept, you’ll see the discrepancy: some library objects do not have corresponding header files!

    This includes libraries such as:

    libugpio
    libonioni2c
    libonionpwmexp
    libonionoledexp
    libonionrelayexp
    libuci
    libubus
    libjson-c
    libiwinfo
    

    i was not able to link the libonioni2c library with my main c++ program.
    Kindly, provide me with proper steps for doing that.

    Also, how to implement the linker command. I am new to all this.



  • Any support guys??



  • I have recompiled and copied header files for multiple Onion2 relevant libraries here. Includes: libupgpio, libonioni2c, libonionmcp23008, libonionoledexp, libonionpwmexp, libonionrelayexp, liboniondebug, libalsa, libonionspi and two of my own libs. You can either cross-compile or locally compile the remaining libraries


  • administrators

    @Jasvivek-Reehal In order to use those libraries in your C/C++ code you need to cross-compile your program first using our build system. Please refer to our guide on how to setup the build system, how to compile C programs and how to actually cross-compile programs. You will find all the necessary steps and description. Also, check out our documentation to learn more about Library for Linker. I hope this will help!



Looks like your connection to Community was lost, please wait while we try to reconnect.