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?

0 points

Try asking her.

permalink
report
reply
5 points

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.

permalink
report
reply
1 point

C

permalink
report
parent
reply
4 points

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?

permalink
report
parent
reply
3 points

that does work, it’s a little clunkier than i’d like but it’s better than the code not running

permalink
report
parent
reply
10 points

I struggled with stupid basic things like that (“how do I run a file??!”) when I was beginning to learn programming. What you can do is just open a terminal and run a command, that’s it, like python main.py. Sorry that it doesn’t answer the question.

permalink
report
reply
6 points

TBH, I haven’t really used Kate for coding, but I vaguely remember it having a built in a terminal as a pane, like many IDEs

permalink
report
parent
reply
2 points

When learning a programming language I think it’s better to find the commands you’d use to compile/run the program and run them in the terminal the first few times so you know what’s actually happening behind the run button. Then start running things through the IDE if it’s more convenient. If you tell us the language we can help with the commands (is it C?)

permalink
report
reply
1 point

it’s C, I’ll add that to the post in a second

permalink
report
parent
reply
1 point

it’s C, I’ll add that to the post in a second

permalink
report
parent
reply
9 points

I hadn’t heard of Kate before, so I can’t offer much hands-on advice. I dug around and found a “handbook” here: https://docs.kde.org/stable5/en/kate/kate/index.html

Unfortunately it does look like you need to define a project to compile/run anything, which appears to require manually creating a .kateproject file in the directory as outlined here: https://docs.kde.org/stable5/en/kate/kate/kate-application-plugin-projects.html#project-create

I had exactly the same problem when I moved from languages that were interpreted or combined the IDE and runtime environment into one, and starting to use languages which had their own external compiler. Unfortunately, open source project user documentation is often terrible for beginners (what I found above for Kate seems to be no exception), and IDEs often seem to be written by people who don’t really expect anyone to actually use the included build options (to be fair, most folks seem to like using their own separate build utilities, so probably this is often the case)

If you can tell us which compiler or interpreter you’re using (e.g. gcc, clang, Python), someone can probably tell you how to compile and/or run a single-file program from the terminal with a fairly simple command.

permalink
report
reply
2 points

I believe both clang and gcc are present on my system right now. and yeah, the Kate documentation was a little lacking. they do have little pop-ups letting you know though

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 2.3K

    Monthly active users

  • 971

    Posts

  • 8.7K

    Comments