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

    [Solved] "#include <M5Core2.h>" doesn't compile

    Arduino
    arduino
    2
    6
    7.4k
    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.
    • rh1972R
      rh1972
      last edited by rh1972

      My code has the following with empty setup and loop:

      #include <M5Core2.h>

      When I verify, it terminates with this:

      c:\users\xxxxx xxxxx\appdata\local\arduino15\packages\m5stack\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch5\xtensa-esp32-elf\include\c++\8.4.0\bits\allocator.h:46:10: fatal error: bits/c++allocator.h: No such file or directory

      The file does exist in that location. File doesn't exist in this location, but exists in other directories.

      I'm compiling this on a Core 2, using this guide:

      https://docs.m5stack.com/en/quick_start/core2/arduino

      So, what am I doing wrong?

      teastainT 1 Reply Last reply Reply Quote 0
      • teastainT
        teastain @rh1972
        last edited by

        Hi!
        I verify this simple code no problem.
        #include <M5Core2.h>
        void setup() {
        }
        void loop() {
        }
        Is this what you were talking about?
        -Terry

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        1 Reply Last reply Reply Quote 0
        • rh1972R
          rh1972
          last edited by

          Hi, thanks for the reply.

          While writing my reply, I realised I misread the error. Arduino IDE cannot find "bits/c++allocator.h" which indeed doesn't exist in this directory. It exists in multiple different directories, though.

          I coped "c++allocator.h" into the path stated in my original post, and it got over this error. But, it's now missing another file.

          I could copy all these missing files (assuming there's more), but something seems to be wrong here.

          teastainT 1 Reply Last reply Reply Quote 0
          • teastainT
            teastain @rh1972
            last edited by

            @rh1972 said in "#include <M5Core2.h>" doesn't compile:

            c++allocator.h

            My recent install of Arduino V2.0.3 doesn't have c++allocator.h installed and I could not find it anywhere in my computer.

            So, yes! I agree there must be something else wrong.
            Are you using Arduino V2.0.3?

            Cheers, Terry!

            100% M5Stack addict with several drawers full of product!

            1 Reply Last reply Reply Quote 0
            • rh1972R
              rh1972
              last edited by

              Yeah, I'm using v2.0.3
              I installed the "M5Stack" boards, and then the "M5Core2" libraries, including dependencies. I've tried different versions of the boards.

              I'm I missing something obvious?

              1 Reply Last reply Reply Quote 0
              • rh1972R
                rh1972
                last edited by rh1972

                Well, it's working.

                The path to my Windows profile has a space in it. I created a local account without a space, and my empty program compiled with no issues. Don't know if that's the reason. Very strange.

                Makes me want to reinstall Ubuntu, or something.

                Thanks for the replies, Terry.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post