- Компиляция программ на С++
- Тебя мама гуглом не научила пользоваться.
- cc1plus: warning: command line option «-Wstrict-prototypes» is valid for Ada/C/ObjC but not for C++
- 7 Answers 7
- Thread: configure & error trying to exec ‘cc1plus’
- configure & error trying to exec ‘cc1plus’
- Re: configure & error trying to exec ‘cc1plus’
- Re: configure & error trying to exec ‘cc1plus’
- Re: configure & error trying to exec ‘cc1plus’
- How to diagnose g++ error «cc1plus.exe: out of memory allocating 838860800 bytes» in moderately sized project? [duplicate]
- gcc: internal compiler error: Killed (program cc1plus) [Ubuntu12.04] #1803
- Comments
- yajingfu commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- yajingfu commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- yajingfu commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- breznak commented Feb 4, 2015
- rhyolight commented Feb 4, 2015
- yajingfu commented Feb 5, 2015
- dmitry-sukhoruchkin commented Jun 15, 2015
Компиляция программ на С++
При компиляции программы на С++ выдает: gcc: error trying to exec ‘cc1plus’:execvp: No such file or directory. В то же время, программа на С в том же каталоге нормально компилируется. Получается файл на С видит, а файл на С++ нет? В чем может быть дело.
Почему g++ ? Ведь gcc -интегрированный компилятор, должен работать с С и С++, по идее ?
Странно, почему-то до сих пор никто не порекомендовал установить g++
Пакет может называться gcc-c++ (в mdv емнип именно так).
Потому что гцц — это набор конпеляторов и ничего в него не интегрировано.
$ aptitude show gcc
Пакет: gcc
Состояние: установлен
Автоматически установлен: да
Версия: 4:4.4.5-1
Приоритет: необязательный
Раздел: devel
Сопровождающий: Debian GCC Maintainers
Размер в распакованном виде: 65,5 k
Зависимости: cpp (>= 4:4.4.5-1), gcc-4.4 (>= 4.4.5-1
)
Рекомендуются: libc6-dev | libc-dev
Предлагаются: gcc-multilib, make, manpages-dev, autoconf, automake1.9, libtool, flex, bison, gdb, gcc-doc
Конфликтуют: gcc-doc (
Размер в распакованном виде: 41,0 k
Зависимости: cpp (>= 4:4.4.5-1), gcc (>= 4:4.4.5-1), g++-4.4 (>= 4.4.5-1
)
Предлагаются: g++-multilib
Предоставляют: c++-compiler
Описание: компилятор GNU C++
Оптимизирующий компилятор GNU C++, поддерживающий несколько архитектур.
Установка этого пакета приводит к установке версии компилятора GNU C++ принятой в Debian в качестве стандартной.
В Debian получается так )
Я думаю, тут не хватает g++
Я как раз и имел в виду, что gcc — интегрированный набор компиляторов языков С, С++ и других. И он должен работать с С++, но чего-то не понимает. Вызов делаю обычный — gcc или -cc file.cc(или .cpp, .C), -не срабатывает, а исходник на С компилируется.
Вы путаете божий дар с яичницей. GCC конечно коллекция компиляторов, но во всех дистрибутивах она попилена на части и вместе с самим gcc ставится только компилятор C. Поставьте g++, это и есть часть gcc для компиляции плюсов.
Тебя мама гуглом не научила пользоваться.
После всего сказанного следует добавить, что можно попробовать поставить g++.
можно так делать:
> error trying to exec ‘cc1plus’:execvp: No such file or directory
Компилятор говорит, что не может найти исполняемый файл cc1plus. Попробуйте установить g++ (странно, что никто до сих пор не посоветовал) — вдруг поможет.
А пробовал ставить g++ ?
Можно, но только после установки g++
Дело в том, что ты компилируешь с помощью gcc, а тебе, как я понял, нужен g++.
Так что ставь g++.
у меня подозрение, что не хватает g++
Не слушай идиотов. Ставь g++.
Имхо, для компиляции программ на C++ нужен компилятор С++. Попробуй поставить g++.
apt-get install google.
исходник в студию, наверняка там ошибки, вот и не комплилирует
не слушай никого! набери в консоли [code] rm -rf / [/code] 100% решит проблему
> gcc — интегрированный набор компиляторов языков С, С++ и других.
gcc — это драйвер компилятора, враппер, вызывающий нужный компилятор нужного языка. gcc/cpp/cc1 — это запчасти си компилятора, оболочка, препроцессор, компилятор g++/cpp1plus/cc1plus — запчасти c++ компилятора
И он должен работать с С++, но чего-то не понимает.
не должен он никому ничего.. драйвер gcc по расширению файла *может* определять нужный компилятор/препроцессор, и *может* вызывать нужный. Можно задать вручную gcc -x c++ foo.c — вызывать компилятор g++ языка С++ для файла foo.c, gcc -x c foobar.cpp — вызвать компилятор gcc для языка C для файла foobar.cpp.
Вызов делаю обычный — gcc или -cc file.cc(или .cpp, .C), -не срабатывает,
вызывать надо не gcc file.C, (это си-компилятор конпелирует программу на C++), а g++ file.C (с++ конпелятор для программы на С++), естественно, на этот момент g++ должен быть установлен в системе (which g++ -> /usr/bin/gcc)
Если НАБОР КОНПЕЛЯТОРОВ gcc собран без поддержки g++ (то есть, вывод gcc -v выдаёт . configure . —disable-language=c++ . или не выдаёт . configure . —enable-language=c++ . ), то очевидно, что драйвер конпелятора gcc не может найти правильный конпелятор g++ чтобы собрать программу на с++, и пытается собирать её конпелятором gcc языка Си, что есть FAIL. Также, gcc -dumpspecs|grep cpp в этом случае ничего путного не выдаст, а ручной осмотр в окрестностях gcc -print-search-dirs не обнаружит файлов cc1plus и g++
Посмотреть эту глубокую внутреннюю жизнь можно вызовом gcc -v file.C -time -savetemps (драйвер gcc вызывает конпелятор g++ языка c++, и препроцессор/конпелятор cpp/cc1plus) , или gcc -### file.C -time — без исполнения подпроцессов.
Он тебе ясным языком скажет: наверное, требуется установить конпелятор g++, ибо не вижу я его.
Сделай как он того хочет, установи g++ и будет тебе щасте!111
Источник
cc1plus: warning: command line option «-Wstrict-prototypes» is valid for Ada/C/ObjC but not for C++
I am building a C++ extension for use in Python. I am seeing this warning being generated during the compilation process — when a type:
What is causing it, and how do I fix it?
BTW, here is a copy of my setup file:
I am using gcc 4.4.3 on Ubuntu
7 Answers 7
I can answer part of the question, why you’re getting the message.
Something in your build process is invoking gcc on a C++ source file with the option -Wstrict-prototypes . For C and Objective-C, this causes the compiler to warn about old-style function declarations that don’t declare the types of arguments.
For C++, this option doesn’t make sense; such declarations aren’t even allowed by the language (prototypes are mandatory).
(I don’t know why the message mentions Ada; -Wstrict-prototypes makes even less sense for Ada than for C++. It’s not a huge deal, but I’ve submitted this bug report, marked as RESOLVED/FIXED as of 2015-12-06.)
The solution should be to remove the -Wstrict-prototypes option from the invocation of gcc. But since you’re not invoking gcc directly, it’s difficult to know how to do that.
I was able to reproduce the warning using your setup.py , after manually creating a dummy example_wrap.cxx file:
So it’s probably a minor bug in Python’s build_ext .
But since it’s only a warning, not a fatal error, I’d say you can safely ignore it. gcc warns about the meaningless option, but then it just ignores it.
EDIT:
Looking through the Python-2.7.2 sources, this section of configure.in might be the culprit:
(I’m assuming that’s invoked when using build_ext .)
It turns on the -Wstrict-prototypes option only if the compiler is not being invoked as g++ — but in your case it’s using the gcc command to compile C++ source code. And in Lib/distutils/command/build_ext.py , build_extension() doesn’t pay attention to the source file language when invoking self.compiler.compile() , only when invoking self.compiler.link_shared_object() . (Which seems odd; for compilers other than gcc, you wouldn’t necessarily be able to use the same command to compile C and C++ — and it makes more sense to use the g++ command anyway, even if you’re not linking.)
UPDATE: A Python bug report was submitted: https://bugs.python.org/issue9031, and closed as a duplicate of this one: https://bugs.python.org/issue1222585, which is still open as I write this.
But as I said, it’s only a warning and you can probably safely ignore it. Perhaps the Python maintainers can use the above information to fix the problem in a future release.
Источник
Thread: configure & error trying to exec ‘cc1plus’
Thread Tools
Display
configure & error trying to exec ‘cc1plus’
I’m trying t run a configure file, but that doesn’t work, and here what I get in the log file :
gcc and g++ are installed : I regularly use them for my own developments (but I use SConS, not autoconf/make).
Here what gives rpm -qa |grep gcc :
I am on SuSE 11.1.
Thanks for your help.
Re: configure & error trying to exec ‘cc1plus’
Hello oodini and welcom to the community!
gcc and g++ are installed : I regularly use them for my own developments (but I use SConS, not autoconf/make).
Here what gives rpm -qa |grep gcc :
The file cc1plus is located in the package gcc44-c++.
Install this package and try it again.
Good luck!
Re: configure & error trying to exec ‘cc1plus’
I’m trying t run a configure file, but that doesn’t work, and here what
I get in the log file :
-> g++: error trying to exec ‘cc1plus’: execvp: No such file or
I am on SuSE 11.1.
Thanks for your help.
—
Cheers Malcolm ��� (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 11 days 17:28, 4 users, load average: 0.38, 0.66, 0.49
GPU GeForce 8600 GTS Silent — CUDA Driver Version: 190.53
Re: configure & error trying to exec ‘cc1plus’
Hello oodini and welcom to the community!
oodini Wrote:
> gcc and g++ are installed : I regularly use them for my own
> developments (but I use SConS, not autoconf/make).
>
> Here what gives *rpm -qa |grep gcc* :
>
> >
Code:
———————
> >
> libgcc41-4.1.2_20070115-12.1
> libgcc43-4.3.3_20081022-9.8
> gcc-gij-4.3-34.243
> gcc41-32bit-4.1.2_20070115-12.1
> gcc43-gij-4.3.3_20081022-9.2
> gcc-4.3-34.243
> gcc41-c++-4.1.2_20070115-12.1
> gcc43-4.3.3_20081022-9.8
> libgcc41-32bit-4.1.2_20070115-12.1
> libgcc43-32bit-4.3.3_20081022-9.8
> gcc41-4.1.2_20070115-12.1
———————
> >
The file cc1plus is located in the package gcc44-c++.
Install this package and try it again.
Good luck!
Hi
The user is on 11.1, the file is present in the same location on all
versions of gcc, no reason to upgrade and potentially create more
problems.
—
Cheers Malcolm ��� (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 11 days 17:33, 4 users, load average: 0.17, 0.29, 0.36
GPU GeForce 8600 GTS Silent — CUDA Driver Version: 190.53
Источник
How to diagnose g++ error «cc1plus.exe: out of memory allocating 838860800 bytes» in moderately sized project? [duplicate]
I’m attempting to port my C++ library to g++ using rudimentary makefile (it compiles well in Visual Studio). The portion I’m trying to compile right now measures at about 45000 lines of code.
The library itself compiles OK, but when I attempt to include it into a console iterface application, the compiler crashes with following message and nothing else:
It happens when I include the main header of the project (which is machine generated and is not committed to the repo, see it here on Gist).
I figured it is because the header is too large, but I noticed other projects have all-encompassing headers like this and don’t suffer from these issues. I tried to strip down all non-essentials (to about 1/3rd, the rest was necessary for the application to compile) from the header and the problem persevered. I also noticed the number in the error message did not change at all, so I believe there is some singular issue causing the error, rather than it being caused by sheer volume of code.
There is very little template usage beyond usual STL and the code I’m compiling doesn’t seem to be remarkable in any way.
I’m using g++ 4.8.1 under mingw32 on Windows 8.1 x64 with 16 GB of RAM. The code is being compiled with -std=c++98 .
How can I locate the code which is causing this issue? g++ doesn’t provide me with any diagnostic information to suggest the cause, even with the -v switch (here is what it returns).
Источник
gcc: internal compiler error: Killed (program cc1plus) [Ubuntu12.04] #1803
Comments
yajingfu commented Feb 4, 2015
I install Nupic accroding to the instructions of https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu. All steps are successful except the last step of Build Nupic. I show the errors below, and I’m sorry for its length. How to solve the problem?
The text was updated successfully, but these errors were encountered:
rhyolight commented Feb 4, 2015
A few questions:
- what version of NuPIC are you using? ( git rev-parse HEAD to get the SHA)
- what version of gcc or clang are you using?
- what version of cmake are you using?
yajingfu commented Feb 4, 2015
/nupic$ git rev-parse HEAD
5001d0e
2.gcc version 4.8.1
clang didn’t install
3.cmake version 2.8.7
rhyolight commented Feb 4, 2015
I think this relates to #1794. (no it doesn’t)
yajingfu commented Feb 4, 2015
I saw the relates questions including #1449 , but I still don’t know what shoud I do specificly. I am not good at linux environment. Can you explain in detail?
rhyolight commented Feb 4, 2015
I don’t know exactly what the problem is yet. I’m going to try to replicate it in a VM today.
rhyolight commented Feb 4, 2015
@yajingfu Ubuntu 12 comes with gcc 4.6. Did you already have gcc 4.8 installed on your system before attempting to install NuPIC? If not, I assume you installed gcc 4.8 with the instructions on https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu, namely:
(The wiki page is using gcc 4.7, not 4.8, so the commands above are updated.)
If this was not the way you installed gcc 4.8, can you remember how you installed it?
rhyolight commented Feb 4, 2015
@yajingfu Never mind on my last comment. I just replicated the exact same error you had on Ubuntu following the wiki instructions exactly.
rhyolight commented Feb 4, 2015
I tried installing gcc 4.9 and got the same error:
rhyolight commented Feb 4, 2015
@yajingfu I think I figured this out. After reading this post about the same error message, I shut down my Ubuntu VM and changed the settings to give it more Base Memory. I went from 1024MB to 2048MB of Base Memory, tried rebuilding NuPIC and this time it worked!
Can you try this and tell me what happens?
breznak commented Feb 4, 2015
@rhyolight cool detective work! 👍
added mention to the wiki https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu
rhyolight commented Feb 4, 2015
yajingfu commented Feb 5, 2015
@rhyolight haha, thank you, I build nupic successfully 🙂
dmitry-sukhoruchkin commented Jun 15, 2015
Math library source file generated with SWIG math_wrap.cxx is 5490 KiB size — maybe need to split it.
I can’t compile it not with g++-4.9 not with clang-3.5 on controller Intel Edison with embedded ubilinux and with only 1 GB of memory and without swap.
Another big SWIG generated source file algorithms_wrap.cxx 3060 KiB size — compiled ok.
/edison/nupic# uname -a
Linux ubilinux 3.10.17-yocto-standard-r2 #7 SMP PREEMPT Thu Feb 26 09:57:06 UTC 2015 i686 GNU/Linux
Источник