Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    ESP32 Compile Error with BME680

    ESP32 Compile Error with BME680

    Jo_Felus
    Member

    Hello,
    I just want to get the library working in Arduino IDE 1.8.13. However, it always fails to compile. I have adjusted the platform.txt, however it did not do anything. I have downloaded the library from github (https://github.com/BoschSensortec/BSEC-Arduino-library). It always comes back the same error when compiling with the ESP32 board. Where is my mistake?

    Here is the debug code:

     

    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec11beginCommonEv+0x4): undefined reference to `bsec_init'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec11beginCommonEv+0x8): undefined reference to `bsec_get_version'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec18updateSubscriptionEP21bsec_virtual_sensor_thf+0x0): undefined reference to `bsec_update_subscription'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec8setStateEPh+0x10): undefined reference to `bsec_set_state'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec15readProcessDataEx19bsec_bme_settings_t+0x14): undefined reference to `bsec_do_steps'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec3runEx+0x0): undefined reference to `bsec_sensor_control'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o):(.literal._ZN4Bsec3runEx+0x4): undefined reference to `bsec_get_state'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o): In function `Bsec::beginCommon()':
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:476: undefined reference to `bsec_init'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o): In function `Bsec::getVersion()':
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:476: undefined reference to `bsec_get_version'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o): In function `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)':
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:476: undefined reference to `bsec_update_subscription'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o): In function `Bsec::setState(unsigned char*)':
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:476: undefined reference to `bsec_set_state'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o): In function `Bsec::readProcessData(long long, bsec_bme_settings_t)':
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:385: undefined reference to `bsec_do_steps'
    libraries/BSEC_Software_Library/BSEC_Software_Library.a(bsec.cpp.o): In function `Bsec::run(long long)':
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:200: undefined reference to `bsec_init'
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:210: undefined reference to `bsec_update_subscription'
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:210: undefined reference to `bsec_sensor_control'
    /Users/Service/Documents/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:246: undefined reference to `bsec_get_state'
    collect2: error: ld returned 1 exit status
    exit status 1
    Error compiling for board DOIT ESP32 DEVKIT V1.

     

    I have attached the platform.txt.
    Thank you

    7 REPLIES 7

    This fix works for me too. Thanks for figuring this out!

    The only change I had to make to my platform.txt file was this change. 

    By the way, for this fix to work on my machine, I had to remove an extra space. Specifically, the space before "ldflags" had to be removed from here: {compiler.libraries. ldflags}

     

    BSTRobin
    Community Moderator
    Community Moderator

    Good news. Thank you for sharing.

    Thanks for that, it worked here. I don't know why because this line seems weird to me.

    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