How to fix cc1plus fatal error problem in C++? - c++

When I try to use g++ compiler to my .cpp file it says
g++: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
compilation terminated
I have already installed g++ and gcc, I also installed C++ extension in my Vscode. I try to uninstall g++ and vscode with its extension, but it didn't help.

Related

g++: fatal error: cannot execute 'as': CreateProcess: No such file or directory compilation terminated

Hello, I'm trying to learn c++, having installed VStudio Code and MinGW, I was ready to get started but when I try to run the code it says this error:
g++: fatal error: cannot execute 'as': CreateProcess: No such file or directory
compilation terminated.
I tried searching for answers to this error but I so far no luck. What can I do to fix this error? what is causing this error?
You have to install MinGW's binutils before you use any compiler of GCC, try to find out it in the MinGW get program.

Emscripten: fatal error: sys/cdefs.h: No such file or directory when compiling for 32 bit

When trying to compile an existing C++ project with emscripten I got the following error:
emmake make LINUX
In file included from /usr/include/stdio.h:27:0,
from src/abinitplugin.c:50:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
I am able to compile for LINUXAMD64, but I need it specifically 32-bit. How do I solve it?

Is it possible to compile c++ using Clang only on windows?

I really tried a lot. Clang does not come with standard C++ includes, and obviously can not find them :
clang++ file.cpp -o file.out
C:\Folder\file.cpp:1:11: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
Passing the mingw includes by arguments, it returns another error:
clang++ -target x86_64-w64-mingw32 C:\Folder\file.cpp -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++ -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\x86_64-w64-mingw32 -IC:\MinGW\mingw64\x86_64-w64-mingw32\include -o C:\Folder\file.out -std=c++11
clang++.exe: error: unable to execute command: program not executable
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
When I use -c it does not use the linker and also not generate an executable file.
Edit : I'm running on windows
Run your commands from "x64 Native Tools Command Prompt for VS 2017", or something similar. It will setup some required env vars for you.

gSoap error : xlocale.h No such file or directory

I am trying to create C++ soap webservice client in Windows 7. I am using gSoap and I followed gSoap tutorial.
first and second commands worked but
c++ -o main main.cpp soapC.cpp soapcalcProxy.cpp stdsoap2.cpp
command did not work.
error is
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\user\Desktop\soap>C:\MinGW\bin\mingw32-g++.exe -o main main.cpp soapC.cpp soapcalcProxy.cpp stdsoap2.cpp
In file included from soapStub.h:22:0,
from soapH.h:16,
from calc.nsmap:2,
from main.cpp:16:
stdsoap2.h:651:23: fatal error: xlocale.h: No such file or directory
compilation terminated.
In file included from soapStub.h:22:0,
from soapH.h:16,
from soapC.cpp:19:
stdsoap2.h:651:23: fatal error: xlocale.h: No such file or directory
compilation terminated.
In file included from soapStub.h:22:0,
from soapH.h:16,
from soapcalcProxy.h:16,
from soapcalcProxy.cpp:14:
stdsoap2.h:651:23: fatal error: xlocale.h: No such file or directory
compilation terminated.
In file included from stdsoap2.cpp:60:0:
stdsoap2.h:651:23: fatal error: xlocale.h: No such file or directory
compilation terminated.
How can I solve it ?
I am using Windows 7 64 bit and mingw.
Thanks.
I had the same problem, I solved it by adding the -DWITH_NO_C_LOCALE option when compiling.
Source: https://sourceforge.net/p/gsoap2/bugs/1098/

Newbie question f2c compilation problem: cc1plus error: /include: not a directory What does this mean?

I am having problems with compiling code on my Mac (OS X, 10.6.5).
The code uses f2c.
I don't understand the error, and would really appreciate any help. I wondered if it might be a problem with my compiler, and just in case I reinstalled Xcode, which installs a new g++ compiler. But I still get the same error.
Here's the error:
cc1plus: error: /include: not a directory
cc1plus: error: /lib: not a directory
make: *** [Task1.o] Error 1
Thanks!
This may be an error in the installation of your gcc compiler. It seems it may be looking for includes in /usr/include, but it is missing the first part of the directory. Try executing:
$ gcc -v
to see what directories the gcc you're using has by default. In my case, I see
--prefix=/usr
as one of the options.