🤖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

    Scheduled Pinned Locked Moved Arduino
    arduino
    6 Posts 2 Posters 10.5k 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.
    • rh1972R Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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

                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