Cc1plus error unrecognized command line option std gnu 11

ProgrammerAH Programmer Guide, Tips and Tutorial cenos Upgrade g++ gcc(cc1plus: error: unrecognized command line option “-std=c++11”) Error using mex cc1plus: error: unrecognized command line option “-std=c++11” 1, download the source code is here. To be on the safe side, 4.8.5 is selected. If you need another version, just change the version number $wget HTTP:// […]

Содержание

  1. ProgrammerAH
  2. Programmer Guide, Tips and Tutorial
  3. cenos Upgrade g++ gcc(cc1plus: error: unrecognized command line option “-std=c++11”)
  4. Cc1plus exe error unrecognized command line option std gnu 11

ProgrammerAH

Programmer Guide, Tips and Tutorial

cenos Upgrade g++ gcc(cc1plus: error: unrecognized command line option “-std=c++11”)

Error using mex

cc1plus: error: unrecognized command line option “-std=c++11”

1, download the source code

is here. To be on the safe side, 4.8.5 is selected. If you need another version, just change the version number

$wget HTTP:// ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz
2. Download dependency package & pre-installed

compiling and installing GCC depends on the MPC, MPFR, GMP package. Fortunately, GCC source script can easily download the dependency package.

$tar ZXF gcc-4.8.5.tar. Gz

You can see in this script that the version Numbers of the dependent packages are MPC-0.8.1, MPFR-2.4.2, gMP-4.3.2, in that order.
3, $yum -y install glibc-devel. I686 –setopt=protected_multilib=false
4. Compile and install

$ cd .. // The main reason for doing this is to create the build folder outside of the source code

$mkdir GCC – build – 4.8.5

$mkdir /usr/local/gcc-4.8.5 // include file.

$mkdir/usr/local/GCC// placed bin +.lib file

$CD GCC – build – 4.8.5

$ ../gC-4.8.5 /configure –prefix=/usr/local/ gC-4.8.5 –exec-prefix=/usr/local/ GCC –enable-languages= C, C ++ // To save time, only C and C ++ are compiled here

$ make & & make install

in order to avoid multiple versions of GCC in the system after installation, the directory to compile and install is directly specified under /usr/local/4.8.5 and /usr/local/gcc. If no -prefix is specified, it will be installed under /usr/local by default.

make after a long wait, done

5, environment variable configuration

rename GCC /g++ and keep the old version

$mv /usr/bin/ GCC /usr/bin/ GCC -4.4.7

$mv /usr/bin/g++ /usr/bin/g++-4.4.7

$export PATH=/usr/local/ GCC /bin:$PATH # use the latest GCC /g++;

confirm version number

1. Build folder to the wrong location stubs-32. H cannot be found, CentOS is 64 bit

make[5]: *** [_muldi3.o] Error 1

make[5]: Leaving directory ‘/home/wei/gcc-4.8.5/gcc-build-4.8.5/x86_64-unknown linux-gnu/32/libgcc’

solution: install a 32-bit glibb-devel that ignores multiple versions of a piece of software.

$ yum -y install glibc-devel.i686 –setopt=protected_multilib=false

is a new build folder in the source tree and needs to be used in a separate folder. The solution is to create a new folder outside of the source code, the resolved code has been updated to the above.

First, we highly recommend that GCC be built into a separate directory from the sources whichdoes not reside within the source tree. This is how we generally build GCC; Building where srcdir == objdir should still work, but doesn’t get extensive testing; building where objdir is a subdirectory of srcdir is unsupported.

Источник

Cc1plus exe error unrecognized command line option std gnu 11

Hi there
Compiler G++
I recently switched to Ubuntu from Windows 8.I downloaded this code from a link that was in my book (C++ priner 5th edition)

This works on windows but not linux . its a .h (Header)

In file included from main.cpp:2:0:
Sales_item.h:20:20: warning: defaulted and deleted functions only available with -std=c++0x or -std=gnu++0x [enabled by default]
Sales_item.h:34:27: error: ISO C++ forbids initialization of member ‘units_sold’ [-fpermissive]
Sales_item.h:34:27: error: making ‘units_sold’ static [-fpermissive]
Sales_item.h:34:27: error: ISO C++ forbids in-class initialization of non-const static member ‘units_sold’
Sales_item.h:35:22: error: ISO C++ forbids initialization of member ‘revenue’ [-fpermissive]
Sales_item.h:35:22: error: making ‘revenue’ static [-fpermissive]
Sales_item.h:35:22: error: ISO C++ forbids in-class initialization of non-const static member ‘revenue’

ok ill search Google..And thank you so much

Edit ..it dosnt show the c++11 in the compilers plugin tab(codeblocks) so I just switched to windows 8 back

i get error
cc1plus error: unrecognized command line option `-std=c++11

and when i change it to std=c++11 i get an error
g++ error: std=c++11: No such file or directory

same with std=c++0x

Odd, I don’t get any errors when I compile any of my old code with

Whats ur version of GCC do this command to check g++ —version

mine is 4.6.3..And do u use COde:Blocks.

How did u install ur G++..can u send me a site,,thanks

edit: i changed to 4.8.1..let me see if it works

Edit again: YES IT WORKS..THANKS ALL SO MUCH. It worked. i just needed to update with a few commands

CaptainBlastXD wrote:
but why do not many ppl program with linux

Many people do program with linux. They just released a steam client for linux and slowly porting steam games to linux ports. Almost all open source projects are people that use linux distros.

What makes you think there are no linux programmers? I’ve been doing this for 17 years and have been using a linux distro of some sort for 12 years now. I know quite a few linux programmers at a few sites.

Oh well the answer to that is because Ubuntu users use the Ubuntu forums to ask programming questions and same for other linux questions. Linux is a programmer’s operating system and has been considered this for years. It is only recently that distros like ubuntu have started trying to get a user friendly interface in order to attract non-programmers into linux.

Not sure if the same is said for Windows. I know there are XNA and Unity forums, but I don’t know if Microsoft has a Windows specific forum for programming. Though there are only 3 pages difference between the two.

Depends on how you take that though. You can take it as Linux is so easy to develop for that it doesn’t need tons of questions or well documented. Or. Well, okay one way to look at it, Windows API and libs are so confusing that people have to ask tons of questions to figure out what they are doing. 😉

Источник

  • Forum
  • General C++ Programming
  • using c++11 in Mac operating system

using c++11 in Mac operating system

Hello,

I would like to use c++11 in my Mac system. Could someone show me how to install the compiler of c++11 to use g++ with the option -std=gnu++11 or g++ -std=c++0X in the terminal.
I used :
clang++ -std=gnu++11 test.cpp

but I get the error:
error: invalid value ‘gnu++11’ in ‘-std=gnu++11’

Thanks
Younès

I just use:

g++ -std=c++11 test.cpp -o test

Are you using Mavericks, by any chance? Guessing the reason the gnu flags bugger is because gcc in Mavericks actually links to Clang. If you want to use gcc you can install it using Macports or Homebrew.

Last edited on

I am using Mountain OS.
I try
g++ -std=c++11 test.cpp -o test
But the bash returns the following error:

cc1plus: error: unrecognized command line option «-std=c++11»

same for:
gcc -std=gnu++11 test.cpp

I get the error:
cc1plus: error: unrecognized command line option «-std=gnu++11»

My question relies with the installation of g++ or gcc that compiles using the standard: c++11.

Thanks
Younes

> I try
> g++ -std=c++11 test.cpp -o test

Try
clang++ -std=c++11 test.cpp -o test

You have to make sure that the version of compiler you are using supports c++11 with the

-std=c++11 or -std=gnu++11

options. For gcc compilers, you need atleast version (4.7):

g++.exe (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

From this page, you can see that you need atleast version 4.7:
http://gcc.gnu.org/projects/cxx0x.html

For llvm compiler clang, you need just version 3.3 to get all the c++11 features

From http://coliru.stacked-crooked.com/

clang version 3.5 (trunk 198621)
Target: x86_64-unknown-linux-gnu
Thread model: posix

So with the just version 3.3 you have both c++11 and c++14 under your belt:
http://clang.llvm.org/cxx_status.html

EDIT: It also seems that for you to get clang on your apple product, you need xcode installed (just tried it on a mac air). So if you don’t have that already, I suggest you get on it because xcode unlocks the full potential of software development on apple.

Last edited on

http://clang.llvm.org/get_started.html

edit:
coliru.stacked-crooked probably wont have a download link because like ideone, it is meant to just run the code and return the output to the browser

Last edited on

Topic archived. No new replies allowed.

Я пытаюсь скомпилировать с помощью g++ и флагов -std=c++11 или c++0x.

Однако я получаю эту ошибку

cc1plus: error: unrecognized command line option "-std=c++11"

g++ —version

g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

03 фев. 2013, в 18:20

Поделиться

Источник

4 ответа

Увидев из вашей версии g++, вам нужно ее плохо обновить. С++ 11 доступен только с g++ 4.3. Самая последняя версия — 4.7.

В версиях pre-g++ 4.7 вам нужно будет использовать -std=c++0x, для более поздних версий вы можете использовать -std=c++11.

antonijn
03 фев. 2013, в 17:54

Поделиться

Цитата из gcc-сайта:

Функции С++ 11 доступны как часть компилятора GCC «mainline» в соединительной линии репозитория GCC Subversion и в GCC 4.3 и более поздних версиях. Чтобы включить поддержку С++ 0x, добавьте параметр командной строки -std = С++ 0x в вашу командную строку g++. Или, чтобы включить расширения GNU в дополнение к расширениям С++ 0x, добавьте -std = gnu ++ 0x в вашу командную строку g++. GCC 4.7 и более поздние версии поддерживают -std = С++ 11 и -std = gnu ++ 11.

Возможно, вы используете версию g++, которая не поддерживает -std=c++11. Вместо этого попробуйте -std=c++0x.

Доступность функций С++ 11 предназначена только для версий >= 4.3.

stefan
03 фев. 2013, в 16:31

Поделиться

вы должны попробовать это

g++-4.4 -std=c++0x or g++-4.7 -std=c++0x

papo
20 фев. 2014, в 18:27

Поделиться

Я также получил ту же ошибку, компиляция с флагом -D исправлена, попробуйте следующее:

g++ -Dstd = С++ 11

pankaj kushwaha
05 май 2015, в 08:51

Поделиться

Ещё вопросы

  • 0PHP Division результатов автоматически округляется число
  • 1Как передать составной список в качестве аргумента?
  • 0Таймер высокого разрешения Linux в многопоточной среде?
  • 1Можно ли скрыть номер, который вызывается из приложения?
  • 0Выполнить команду, используя popen
  • 0Как проверить флажок установлен или нет? [Дубликат]
  • 1Android Убить всех открытых ProgressDialogs?
  • 0Как получить свойства браузера с помощью PHP?
  • 0передача данных td на скрытый ввод и последующее размещение с помощью PHP
  • 0Как получить доступ к переменной из родительского класса
  • 0Как проверить поле ввода флажок со значением при загрузке страницы, используя jquery
  • 0Javascript: Почему мой JavaScript не запускает обе анимации?
  • 1Фильтрация данных по категориям для статистического теста в Python
  • 0C ++ Улучшить файл карты памяти
  • 1Отключить текст под изображением штрих-кода в Code39Bean
  • 0Войти и оплатить с помощью интеграции с Amazon
  • 0Добавление CSS в DIV, когда что-то нет JQuery
  • 0Макет бюллетеня падает с Gmail
  • 0Перезапись URL с использованием include не загружает таблицу стилей
  • 1HornetQ Reconnect-попытки не работают с DefaultMessageListenerContainer
  • 0Невозможно установить Angularjs на Windows 7
  • 1Панель поиска контактов избранного
  • 0Очень маленькие таблицы MySQL игнорируют индексы?
  • 1Как избежать ошибки числового переполнения с экспоненциальными членами?
  • 1Идентификатор счета в программе банка Java не повышается?
  • 1Ошибка создания бина для org.springframework.beans.propertyeditors.StringTrimmerEditor
  • 1Как мы можем скопировать данные столбца данных таблицы данных в другую таблицу данных?
  • 0Результат запроса показывает нежелательный текст формулы SQL SUM в отображении PHP / HTML
  • 1Почему событие отметки времени в новом классе вызывает метод из form1 один раз, а в следующий раз он ничего не делает?
  • 0JS Rolling Link — используя Linkify — как нацелить на конкретный класс?
  • 1ListView и изображения
  • 0ссылка на веб-форму на основе конкретного выбора контента
  • 0Angular JS, ошибка: [$ injector: nomod] Модуль ‘blogger.posts.controllers’ недоступен
  • 0Angularjs — индивидуальная ширина директивы
  • 1Создание комплексного запроса к сайту (общественная транспортная компания) в C #
  • 1Калибровочная игольчатая точка
  • 0Angularjs — угловая 1.4.4 нг-модель на выборочном поле возвращает недопустимые значения
  • 0Ошибка компоновщика при использовании кода C ++ в приложении iPad
  • 0Объедините шейдеры с DirectX 11
  • 0Системная переменная логина ошибки страницы аккаунта
  • 1Как протестировать Doze Mode на Android?
  • 1Eclipse: ошибка при добавлении внешних файлов классов / jar в путь сборки: «XYZ не может быть разрешен для типа»
  • 0Фильтры LESS и IE9: нет для совместимости с SVG-градиентом?
  • 0Кнопка HTML Javascript не работает
  • 1Установить MongoDB на тот же экземпляр AWS EC2, что и мое существующее приложение NodeJS?
  • 0Как открыть соединение с MySQL DataBase на другом ПК? [Дубликат]
  • 1Ошибка выполнения вычислений для сгруппированного запроса LINQ с выводом чисел IEnumerable <decimal> и IEnumerable <decimal?>
  • 0Почему у меня есть вывод знака «=» и 2 смайлика вместо правильного вывода? C ++
  • 0$ http-вызов angularjs не распознает заголовки
  • 1XmlSerializer не может десериализовать XML, содержащий зашифрованную строку

Сообщество Overcoder

gcc 4.7 was the first version released after the standard was ratified. Prior to that version, the option was spelled -std=c++0x because it was not known which year the standard would be completed, and as you can tell, the expectation was that it would be in a single digit year prior to 2010, i.e. the ‘x’ represents an unknown digit.

C++14 is on track to be ratified very soon, but it still technically has not been passed yet. Current compilers accept -std=c++1y to indicate C++14 mode, reflecting the same uncertainty that it will be ratified in 2014. (But in this case it’s a much less invasive standard and it would be extremely surprising for it not to pass this year.)

With all that out of the way, the fact that you’re using gcc <= 4.6 means that you won’t be getting a complete C++11 experience. There is a chart here. gcc was not feature-complete in language conformance until 4.8.1, and it wasn’t feature complete in library conformance until 4.9.0. (<regex> is the notable last library feature that doesn’t exist in working form in 4.8.)

Понравилась статья? Поделить с друзьями:
  • Cc1 error unrecognized
  • Cc1 error no include path in which to search for stdc predef h
  • Cc1 error code model kernel does not support pic model
  • Cd16 ошибка мта как исправить
  • Cc1 error code model kernel does not support pic mode