C++11のcompile

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
da0

C++11のcompile

#1

投稿記事 by da0 » 9年前

g++ でC++11で書かれたprogramをcompileするにはどうすればいいのでしょうか?
環境はg++ -vによると

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=
ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
--enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c+
,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-
ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/g
p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld -
with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable
libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=
mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)

アバター
h2so5
副管理人
記事: 2212
登録日時: 13年前
住所: 東京
連絡を取る:

Re: C++11のcompile

#2

投稿記事 by h2so5 » 9年前

オプションに -std=c++11 をつけてください。

da0

Re: C++11のcompile

#3

投稿記事 by da0 » 9年前

ありがとうございます。解決しました

閉鎖

“C言語何でも質問掲示板” へ戻る