Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Including a static library (.a) without adding to XDK SDK

    Highlighted
    New Poster

    Including a static library (.a) without adding to XDK SDK

    Dear All,

    I have a question regarding including a static library in XDK. I have followed the instructions here: https://developer.bosch.com/web/xdk/including-a-static-library-.a-

    Before trying this however, I tried to use a static library from my project, within my project I created a folder structure->

    dependencies/mProcotol/ with my static lib in dependencies/mProcotol/ and my includes in: dependencies/mProcotol/Inc/

    However, it just doesn't seem to find the header files I have in mProcotol/Inc...

    I have gone into the properties-> C/C++ general-> paths and symbols and included the directory, the library, and the library directory.

    Is there something else I am missing. I have used this static library successfully on STM32 using CUBEIDE which uses eclipse also using similar settings...

    Thanks,

    Oliver

    1 REPLY 1
    Highlighted
    New Contributor

    Re: Including a static library (.a) without adding to XDK SDK

    Hello OliverJ

    I Hope you have created your own library folder under "SDK\xdk110\Libraries" path

    Make Sure that below mentioned things are done properly,

    1. Browse to the SDK libraries folder and create the folder "OwnLibs".

    2. Create a subfolder "include" and put your header files into it (e.g. StaticLib.h).

    3. Create another subfolder "source" and put your archive files into it (e.g. StaticLib.a).

    4. Navigating to SDK > xdk110 > Common folder, Open the common_settings.mk file. Add the following code snippet to it:

     

    OWN_LIBRARIES_DIR = $(BCDS_LIBRARIES_PATH)/OwnLibs

     

     

    Attached screenshot below for your reference,

    OWN_LIBRARIES_DIR.png

    Step-4 defines the path to your own archive and header files

    5. Navigating to SDK > xdk110 > Common folder, Open the application.mk file. Add the following code snippet to it:

     

    -isystem $(OWN_LIBRARIES_DIR)/include

     

     
     

    Attached screenshot below for your Reference,

    fig2.png

    Step-5 sets the include path for the header file associated to your archive file.

    Note: If the backslash at the end of the previous line is missing, add backlash, else this will cause issues.

    6. Navigating to SDK > xdk110 > Common folder, Open the Libraries.mk file. Add the following code snippet to it:

     

    $(OWN_LIBRARIES_DIR)/source/StaticLib.a \

     

    Attached screenshot below for your Reference,

    fig-3.png

    7. Save all changes made and Clean the project and Build the project.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist