Problems running c++ code in atom


#1

I’m trying to code in atom using c++ and i get this error

gcc-make-run: Compile Error
main.cpp:4: *** missing separator. Stop.

i have installed TDM GCC.


#2

Even though this doesn’t seem like a high-level issue, I would suggest asking in a forum frequented by C++ developers. I don’t know how many are on here or how long it will take before one sees your post.


#3

Your C++ code compiles for me with gcc 6.3.0 on Debian Linux. I tried it with three different standards flags and all compiled properly.

I was able to download the TDM toolchain, launch my Git Bash shell, and compile that file with g++.exe main.cpp. It runs and prints 1. I think the error may be in the way you have your build command configured.

Otherwise, there’s nothing special happening on line 4. Did you paste this code in from a webpage? Any chance there’s some weird hidden characters there or something?

I don’t know anything about Atom. I’m just passing by.


#4

I wrote that code myself so it should work, i mean it works. When ii use CodeBlocks it works perfectly. MinGW is also added in my path so gcc-compiler should work. Oh well if it doesn’t work so i guess i will stick to codeblocks. I wanted to try Atom because of it’s auto completion function (and i also liked that you can costumize it however you want).


#5

Atom doesn’t have any culpability here. Either the specific package you’ve chosen is handing off the file incorrectly (you could try gpp-compiler, script, or process-palette instead of gcc-make-run; out of all of those, process-palette gives you absolute control and a lot of functionality) or the compiler has an issue with something in the file.