Gpp error : no such file or directory - c++

I am trying to compile and run my basic c++ code in Atom .
But it shows an error like
gpp error : No such file or directory.
I was referring stack overflow and got some ideas to solve like Adding path of compiler and removing ".h" from "iostream.h".. but failed please help !!
here is the code
enter image description here
here is the error msg :
"g++: error: gpp: No such file or directory
g++: error: compiler: No such file or directory "
thank you for answering ..

Related

cc1plus.exe: fatal error: world.cpp: No such file or directory compilation terminated

i have problem with the code
everytime the code is done, running the code is still normal. when exiting visual code studio and re-entering, the code does not run end show the error as below
cc1plus.exe: fatal error: world.cpp: No such file or directory
compilation terminated.
I also got the same error, and to fix the error is easy. It may because your file name contains spaces. More information about this and how I know this is here:https://www.youtube.com/watch?v=Z5QxAjaiQp8. (Altough he got the different error raised but the way to fix it is still the same).
I resolved the error by removing the spaces between the name of the file I was saving. Earlier I was naming my c++ file as example- "test file.cpp", but when I removed the blank space i.e. "testfile.cpp" or "test_file.cpp", the error resolved.
If you are compiling the code using your terminal, you could check if the file you want to run is in that folder using dir for Windows or ls for Linux. If it is not, change to the folder where the file is and try running the file again.

fatal error: 'ext/hash_map.h' file not found on Mac

I run some downloaded code using hash_map.h. But when I compile it using g++, it gives error message:
fatal error: 'hash_map.h' file not found
I search on google, some one suggests to replace 'hash_map.h' by 'ext/hash_map.h' and add 'using namespace __gnu_cxx;'. But still I get the error message 'fatal error: 'ext/hash_map.h' file not found'.
I type "sudo find / -name hash_map.h" in the terminal of my Mac, and get the following results.
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/c++/4.2.1/backward/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/c++/4.2.1/debug/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/c++/4.2.1/backward/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/c++/4.2.1/debug/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/c++/4.2.1/backward/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/c++/4.2.1/debug/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/c++/4.2.1/backward/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/c++/4.2.1/debug/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1/backward/hash_map.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1/debug/hash_map.h
How to link hash_map.h to the downloaded code?
I add the path to the hash_map.h to the Makefile as follows.
g++ -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1/ -c target.cpp
And I replace 'hash_map.h' by 'debug/hash_map.h', and add 'using namespace __gnu_cxx;'.
It works for me.

making a makefile error 'cc1plus' :execvp:no such file or directory

how can i solve this problem :
cc: error trying to exec 'cc1plus': execvp: No such file or directory
make: * [sum.o] Error 1
??
does it need to install any directories for c++ programming language or it is a matter of the way i wrote the code and divide it ! I'm using #ubuntu

g++ fatal error no input file on codeblocks ubuntu

I am new to codeblocks and getting following error when trying to build.
g++ fatal error no input file
Not sure what it means. I try to set the execution dir in project properties but didnt worked and I am stuck with this error. Can anyone help please.
What type of project did u create?
Create a project like this
File->New->Project and select Console Application template

How to get started with twitCurl?

I am trying to use twitCurl and I am following instructions given on
[1]: http://code.google.com/p/twitcurl/wiki/WikiHowToUseTwitcurlLibrary under the Unix/Linux section.
Getting stuck while doing
g++ twitterClient.cpp -ltwitcurl
It gives an error message
In file included from twitterClient.h:4:0,
from twitterClient.cpp:1:
includes/twitcurl.h:8:23: fatal error: curl/curl.h: No such file or directory
compilation terminated.
The file curl.h is inside curl/ but it still gives an error.
Why?
Add -I<path to curl/curl.h> to your building command.