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

    M5Core2 Arduino compiles sketch PlatformIO does not

    Scheduled Pinned Locked Moved Arduino
    5 Posts 2 Posters 7.9k Views
    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.
    • D Offline
      dave17
      last edited by

      Hi I have a nice webradio sketch that compiles fine with Arduino,
      I have imported it into VSCode/PlatformIO, and installed the same libraries/versions that I used in Arduino (M5Core2.h and ESP8266.h) but VS code shows a compilation error saying something like:
      "lib/M5Core2/src/M5Display.h:117:12: error: 'vector' in namespace 'std' does not name a template type..."
      I tried to #include vector.h but it doesn't help?
      How come it compiles in Arduino and not in VSCode/Platformio?

      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by

        Hello @dave17

        that is an odd one. Try including vector (w/o the .h) like this:

        #include <vector>
        

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • D Offline
          dave17
          last edited by

          Thank-you Felix,
          that was helpful, that bit now compiles but I run into another compiling error raised by the ESP8266 libray:
          "In file included from .pio/libdeps/m5stack-core2/ESP8266Audio/src/AudioGeneratorMIDI.cpp:65:
          .pio/libdeps/m5stack-core2/ESP8266Audio/src/libtinysoundfont/tsf.h: In function 'void tsf_channel_midi_control(tsf*, int, int, int)':
          .pio/libdeps/m5stack-core2/ESP8266Audio/src/libtinysoundfont/tsf.h:2100:1: error: insn does not satisfy its constraints:"
          Again I don't understand why it does not compile in my VSCode/Platformio frame while it compiles fine in Arduino when I'm using the same version for the M5Core2 and ESP8266Audio libraries.
          Does it have to do with the c++ compiler? Is it different between the 2 do the libraries have to be adapted to Platformio even if the have the same version number?
          Thanks for your help.

          1 Reply Last reply Reply Quote 0
          • felmueF Offline
            felmue
            last edited by

            Hello @dave17

            sorry, I don't know why this still doesn't compile when using PlatformIO, sorry. Maybe this helps.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              dave17 @felmue
              last edited by

              @felmue
              OK thanks, I will try to look into this, I have the impression that it might be due to a different compiler. By the way do you know if it is possible to convert the arduino sketch into code that can be compiled with classical gc++
              Thanks

              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