• one_old_coder@piefed.social
    link
    fedilink
    English
    arrow-up
    32
    ·
    2 days ago

    In C++, main MUST return int, but it can be omitted, like int main() { }

    If the Pico is a microcontroller without an OS, it’s not supposed to “return,” it makes no sense. It’s like saying “what will you do after you are dead?” You’re supposed to loop forever or something.

    But I may be wrong…

  • MadhuGururajan@programming.dev
    link
    fedilink
    English
    arrow-up
    12
    ·
    2 days ago

    lowkey wanted to suggest writing a program to call other programs… Then I realized I am just suggesting writing a scheduler/init process.

  • jaybone@lemmy.zip
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 days ago

    Doesn’t RPi just run a Debian based distribution (though there are others it can run.) So why is the C/C++ SDK different than any other Linux distro?

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      9
      ·
      2 days ago

      After having done C in an x64 Linux environment using only clang, I was… Flabbergasted? At the myriad of components required to compile for this little piece of shi… I mean piece of wonderful hardware called ARM. 🥰🤣😱

      • Pup Biru@aussie.zone
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        i mean, compiling for linux you’re skipping a lot of shared things because you’ve got the kernel… compiling for a microcontroller your binary is everything there is. if you had to compile the linux kernel and shared libs every time you compiled a single app you’d be amazed at how fast microcontrollers compile :p

        • printf("%s", name);@piefed.blahaj.zoneOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 day ago

          Haha, yeah, it just hit me that the program I’m compiling doesn’t have any environmental support whatsoever once it’s shoved on to the microprocessor, so I guess it’s natural having to “bake in” a lot of other stuff at compilation. Thanks! ˆˆ

      • dracc@discuss.tchncs.de
        link
        fedilink
        arrow-up
        9
        ·
        2 days ago

        I mean, you’re compiling for a different architecture and bare metal. Yeah, it’ll require quite a few different packages from what you typically use. 😊

      • one_old_coder@piefed.social
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

        At the myriad of components required to compile for this little piece of shi…

        The toolchains used to compile code for embedded systems have always been very hard to use. They don’t do that on purpose, but I guess it’s because they are mostly into the hardware side of things, and they don’t follow good practices for the software, like writing useful scripts or functions.

        Most of the time it’s a bunch of scripts that you have to run in a mystical order to create an environment that can build something. I don’t blame them, but they don’t care about polishing stuff because “it works on their machine.”

        • dracc@discuss.tchncs.de
          link
          fedilink
          arrow-up
          5
          ·
          2 days ago

          I’d argue it’s very polished in the Pico SDK. Install a few well defined packages needed for compilation, add three lines to your CMakeLists.txt and a provided script to your repository and it’ll sort out the rest.

  • palordrolap@fedia.io
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Weird question: Is the pictured guy Turkish?

    In my life I’ve known exactly two people from Turkey, completely unrelated to each other as far as I know, and this guy reminds me of both of them.

    Don’t get me wrong, I’ve seen footage and images of people from Turkey where there’s been nothing to remind me of my acquaintances other than the implicit ethnicity. This guy looks like he might be related to both of them without their knowledge.