🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Linker errors and Arduiono setup for ENV Hat

    Scheduled Pinned Locked Moved M5 Stick/StickC
    1 Posts 1 Posters 4.6k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      grlind
      last edited by

      I am having problems linking the example for the M5Sitckc environmental module from github.. I am new to Arduino-- and have created a sketch call MstickC_ENVHat and copied all the code modules into the sketch in "tabs" so I have the main sketch MstickC_ENVHat, and the following in tabs DHT12.CPP, DHT12.h, bmm150.cpp, bmm150.h, bmm150_defs.h

      https://github.com/m5stack/M5StickC/tree/master/examples/Hat/ENV

      I guess I just need to understand how to make this example work as I am not familiar how to get this work?

      I am getting linker errors...

      Linking everything together...
      "C:\Users\grlind\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0/bin/xtensa-esp32-elf-gcc" -nostdlib "-LC:\Users\grlind\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2/tools/sdk/lib" "-LC:\Users\grlind\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2/tools/sdk/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -Wl,--start-group "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\MstickC_ENVhat.ino.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\bmm150.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\AXP192.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\Fonts\Font16.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\Fonts\Font32rle.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\Fonts\Font64rle.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\Fonts\Font72rle.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\Fonts\Font7srle.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\Fonts\glcdfont.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\IMU.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\M5Display.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\M5StickC.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\RTC.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\utility\In_eSPI.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\utility\Sprite.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\arduino_248878\utility\qrcode.c.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\Wire\Wire.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\SPI\SPI.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\FS\FS.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\FS\vfs_api.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\libraries\Adafruit_BMP280_Library\Adafruit_BMP280.cpp.o" "C:\Users\grlind\AppData\Local\Temp\arduino_cache_689927\core\core_fc9f877b7a275e98ef306097fe742a79.a" -lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lfrmn -lapp_trace -lfr_coefficients -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lesp32-camera -lcxx -lxtensa-debug-module -ltcp_transport -lmdns -lvfs -lmtmn -lesp_ringbuf -lsoc -lcore -lfb_gfx -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -limage_util -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lface_recognition -lapp_update -lnghttp -lspiffs -lface_detection -lespnow -lnvs_flash -lesp_adc_cal -llog -ldl_lib -lsmartconfig_ack -lexpat -lfd_coefficients -lm -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lstdc++ -Wl,--end-group -Wl,-EL -o "C:\Users\grlind\AppData\Local\Temp\arduino_build_90317/MstickC_ENVhat.ino.elf"
      C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\MstickC_ENVhat.ino.cpp.o:(.literal._Z4loopv+0x34): undefined reference to `DHT12::readTemperature(unsigned char)'

      C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\MstickC_ENVhat.ino.cpp.o:(.literal._Z4loopv+0x38): undefined reference to `DHT12::readHumidity()'

      C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\MstickC_ENVhat.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_dht12+0x4): undefined reference to `DHT12::DHT12(unsigned char, unsigned char)'

      C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\MstickC_ENVhat.ino.cpp.o: In function `setup()':

      \ccanet\home\grlind\My Documents\Arduino\MstickC_ENVhat/MstickC_ENVhat.ino:116: undefined reference to `DHT12::readTemperature(unsigned char)'

      \ccanet\home\grlind\My Documents\Arduino\MstickC_ENVhat/MstickC_ENVhat.ino:119: undefined reference to `DHT12::readHumidity()'

      C:\Users\grlind\AppData\Local\Temp\arduino_build_90317\sketch\MstickC_ENVhat.ino.cpp.o: In function `_GLOBAL__sub_I_dht12':

      \ccanet\home\grlind\My Documents\Arduino\MstickC_ENVhat/MstickC_ENVhat.ino:161: undefined reference to `DHT12::DHT12(unsigned char, unsigned char)'

      collect2.exe: error: ld returned 1 exit status

      Using library arduino_248878 at version 0.0.5 in folder: \ccanet\home\grlind\My Documents\Arduino\libraries\arduino_248878
      Using library Wire at version 1.0.1 in folder: C:\Users\grlind\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\Wire
      Using library SPI at version 1.0 in folder: C:\Users\grlind\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\SPI
      Using library FS at version 1.0 in folder: C:\Users\grlind\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\FS
      Using library Adafruit_Unified_Sensor at version 1.0.2 in folder: \ccanet\home\grlind\My Documents\Arduino\libraries\Adafruit_Unified_Sensor
      Using library Adafruit_BMP280_Library at version 1.0.4 in folder: \ccanet\home\grlind\My Documents\Arduino\libraries\Adafruit_BMP280_Library
      exit status 1
      Error compiling for board M5Stick-C.

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post