Which package can give me this feature of DevC++

I can open like several files for a project and each can contain a piece of code but when I call them all in main in one of those project files opened it will work.

I can’t seem to make that work. Example in the screenshot below:

What have you tried?

I have tried searching for a package that would help but I couldn’t find one.
Opened a folder for that project, where I saved all the required files there and opened them in the Atom just like in DevC++ but when calling the functions in main I get plenty of errors since they are not within the same file.

What are you using to run your code? What’s generating the error messages? If you don’t know for sure, you should post screenshots of these things and how you interact with them so that we can observe what’s going on.

It sounds like you have a linter package installed. Have you tried actually running the program? If so, and it worked, then the linter package is throwing bad warnings for whatever reason and that’s something that can be figured out.

I have a linter package installed, don’t know if it has to do with this though.

I’m using gcc to compile those programs in C and C++ but as I said if I divide my project into different .c or .cpp files and try to open and run it from one of those files Atom will throw me errors as if these parts were not there so I have to copy-paste everything in one file.

And does the same thing happen if you run your program from the command line?

script will not handle build systems for you. Try a more granular package like process-palette to set up exactly what command and arguments to run when you want to compile.

Sorry for the delay I didn’t test it on the command line just Atom.

So atom can’t understand that my project is in difference files and when the main part calls the other parts I have to manually tell it to do so?

Yeah, but what happens when you do?

So atom can’t understand that my project is in difference files

No, Atom doesn’t understand anything. It needs packages to tell it what to do, but the packages also don’t understand anything about the code you’re trying to build. The compiler is what understands. If the file is being successfully sent to the compiler, but the other files aren’t being found, then one of two things is the case: either the package you have installed is sending the wrong command to the compiler (possible), or you haven’t included the files in the way the compiler expects them to be included. Since you haven’t included any screenshots of your code in Atom or the errors you’re getting (even though I’ve asked you to), I can’t tell you anything about what might be happening. If you want to figure out what’s going on without posting screenshots, you’re going to need to go through the troubleshooting steps yourself and that means trying to run the code using gcc without using whatever package you’ve installed as an intermediary.

I don’t know if you are really understanding my issue.

As you saw from my DevC++ screenshot my project was split in 2 files.
In this case Atom can’t do that. I know it doesn’t understand anything as it is just a text editor, just used Atom doesn’t understand for short.

I made a simple and short example of this (screenshots included this time)


First screenshot is the the main function in which I call a void function. I hope you can see the error generated there. Do you know a way to change how these errors look, it’s really hard to see them.

In this screenshot you can see the void function that I called printATOM which is saved in another file in the same folder shown below.

This is a list of my community packages installed for now:
-atom-beautify,
-atom-clock,
-atom-material-ui,
-autocode,
-autocorrect,
-framer-syntax,
-framerjs-syntax,
-gcc-make-run,
-minimap,
-no-title-bar,
-scroll-through-time,
-share-my-packages,
-teletype

The second screenshot of the printATOM, can’t put more than 1 image in a post

The folder screenshot where the files are saved
35

You will find a simple gcc command fails when you only pass the one main file. script is effectively calling it this way. script does not replace a proper build setup.

I can’t understand your issue without information. If you answer the questions I ask you, then I can tell you exactly what the issue is. In this case, the issue is the fact that you haven’t included the file PART2.C in your main file. Since you have made no indication to the compiler that they go together, it has nowhere to look for the printATOM() function.

Do you know a way to change how these errors look, it’s really hard to see them.

That probably has to do with the theme you’re using. Have you tried changing the UI theme?

1 Like

Yes I know that I didn’t include it in the main file. PART2.c is in the same folder where main is and DevC++ can understand that since it’s a file belonging to the same project. What I’ve been asking is that if you do know any way to tell Atom to do this automatically like DevC++

I fixed this, thanks though :slight_smile:

Aerijo:

script will not handle build systems for you. Try a more granular package like process-palette to set up exactly what command and arguments to run when you want to compile.

You will find a simple gcc command fails when you only pass the one main file. script is effectively calling it this way . script does not replace a proper build setup.

So you are saying that what I’m looking for the process-palette can help me? Is there a way to automate it?

No, you’re going to need to use standard C++ syntax to include code like normal, since you don’t have this one specific IDE covering that for you.

So you are saying that what I’m looking for the process-palette can help me?

Maybe. From Googling, it looks like you can include code files in your command line instruction. However, process-palette isn’t going to have an easy time of counting all of the other files in the same folder (I don’t think it has that built in), so you might have to get creative with your use of variables or only use one external file that always has the same name.

Is there a way to automate it?

Once you write a command in process-palette, you can attach it to a keybinding or have it run when you save your file (don’t do that here) or whatever you like. There’s even a package where you can make your own toolbar buttons that I like to use with it.