I am fairly new to programming and for my cs class i need to run individual programs. they don’t need to interact with anything else, so i am trying to just run the file I’m currently on but Kate just greys out the option. I really want to avoid using projects if i can because they’re just extra effort for no reason when I only need to run a single file. I did try using one, but Kate doesn’t have a new project button for some reason and i had some trouble with Cmake.

I’m aware that these are actually pretty basic things, but I can’t find anything online that actually explains how to use Kate at all. I would try using something else, but every IDE seems to have this same issue where by default it can’t run code and it has no documentation of any kind regarding actually running code, so i’ll just stick with the one that came with my distro.

also as a bonus question, why does every IDE seem to require you to configure every single option before it can run code and why do they all seem to discourage doing anything less than making an entire app?

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        1 month ago

        In that case I would recommend using an IDE that supports C well. On Windows Visual Studio will get you far and it is the easiest to set up with wizards to create projects etc.

        Alternatively you could use VSCode but it’s a bit harder to set up.

        1. Install VSCode
        2. Install the clangd extension from the marketplace. It’s better than the official Microsoft C++ one.
        3. Also install the CMake extension.
        4. Create a CMake project by hand (you need CMakelists.txt and main.c). In the CMake make sure you add
        set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
        

        That will give you perfect code intelligence (error squiggles etc).

  • FourPacketsOfPeanuts@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    What language are you programming in?

    As far as I’m aware, in many cases, Kate just gives you access to the terminal where you can type commands to compile / run your code.

      • FourPacketsOfPeanuts@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 month ago

        So, I’m a bit rusty, but I believe in Kate you would hit F4 to get a terminal window and you would execute

        gcc your_file.c -o your_output_file

        Then after that’s run you’d type just “your_output_file” and hit enter

        I think on windows you’d need to make sure the output file name ends with .exe but I’m not sure about that, maybe someone else can chime in?

          • Rimu@piefed.social
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 month ago

            Great!

            But now try to set a breakpoint and do some debugging and you’ll realise why most devs use real IDEs instead.

            • 3h5Hne7t1K@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              1 month ago

              Dishonest and misleading. gdb ./main.elf, break 45. Learn your tools. Optimize for learning. Select tools that generalize. Avoid lock-in.