#g++: fatal error: input file ‘c++’ is the same as output file

14 messages · Page 1 of 1 (latest)

final ploverBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

#

@dusty storm

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

sterile tulip
#

@dusty storm Your compile command is incorrect

#

If you send it in text I can better point out why

sterile tulip
#

why did you write c++ after g++?

#

It comes down to how you configured that extension then

#

g++ c++ 17.cpp -o c++ means take source code files "17.cpp" and "c++" and output an executable called "c++"

#

which doesn't really make sense, hence the error, and you also don't have a source file called "c++"

#

If you need to check if your compiler supports c++20 you can simply do g++ -std=c++20 someprogram.cpp

#

why did you write "c++" in the compilation line?

#

oh, I see, your filename has a space

#

but yes, if you had an old version of gcc that didn't know what c++20 was it would give you an error

final ploverBOT
#

@dusty storm Has your question been resolved? If so, run !solved :)

final ploverBOT
#

This question is being automatically marked as stale.
If your question has been answered, run !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.