Strange C++ compiling error that only happens in Atom


Hi. I’m fairly new to C++ and am playing around with header files, and for some reason, I keep getting a strange error when compiling. I am using MinGW, and this error only occurs when I use Atom but not when using Eclipse. This code will only compile if I change the #include in my client file to “file.cpp” rather than “file.h.” Can someone please help me? I’m unsure whether this is an issue with Atom or MinGW.


Also, this is the error I keep receiving:

collect2.exe: error: ld returned 1 exit status


Atom doesn’t compile, build or execute code. If you’re running into a problem with a community package you added, you’ll have to tell us which one. It may be faster to open an Issue with the maintainer of the package though. The Atom FAQ has information on how to contact the maintainers of any Atom community package or theme.


collect2.exe: error: ld returned 1 exit status is a linker error.

Most likely, eclipse is generating a make file or make commands automatically for you. (IDEs tend to do that.) Atom does not. You will need to construct a Makefile file for you Atom project.

If eclipse has created one for you, you may be able to use it in your Atom project.


Thanks for the replies. I manage to resolve the issue.


I know its been a long time since you posted but can you help me with this issue which you were experiencing before? Thanks