1

Please help me why does it says "g++.exe: unrecognized option '-static-libstdc++'" when I compile my cpp code in netbeans?

my build output is as follows.

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf make.exe[1]: Entering directory /f/Cpp Projects/StdCpp Projects/Hello' rm -f -r build/Debug rm -f dist/Debug/MinGW_TDM-Windows/hello.exe make.exe[1]: Leaving directory/f/Cpp Projects/StdCpp Projects/Hello'

CLEAN SUCCESSFUL (total time: 1s)

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/f/Cpp Projects/StdCpp Projects/Hello'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_TDM-Windows/hello.exe
make.exe[2]: Entering directory `/f/Cpp Projects/StdCpp Projects/Hello'
mkdir -p build/Debug/MinGW_TDM-Windows
rm -f build/Debug/MinGW_TDM-Windows/main.o.d
g++    -c -g -MMD -MP -MF build/Debug/MinGW_TDM-Windows/main.o.d -o build/Debug/MinGW_TDM-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW_TDM-Windows
g++     -o dist/Debug/MinGW_TDM-Windows/hello build/Debug/MinGW_TDM-Windows/main.o  -static-libgcc -static-libstdc++
g++.exe: unrecognized option '-static-libstdc++'
make.exe[2]: Leaving directory `/f/Cpp Projects/StdCpp Projects/Hello'
make.exe[1]: Leaving directory `/f/Cpp Projects/StdCpp Projects/Hello'

the executable runs fine, but what is that message? please help me understand, beacuse i'm learning cpp.

thank you all.

  • 1
    `-static-libstdc++` was added in GCC 4.5, your version might be older. – Rapptz Sep 22 '13 at 07:03
  • Thanks @Rapptz! You are right, my version check was gcc -v and following was the output. It is gcc 4.4.0 :( `C:\Doc~\Isuru>gcc -v Using built-in specs. Target: mingw32 Configured with: ../gcc-4.4.0/configure --enable-languages=c,ada,c++,fortran,jav a,objc,obj-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enabl e-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enab le-version-specific-runtime-libs --prefix=/mingw --with-gmp=/mingw/src/gmp/root --with-mpfr=/mingw/src/mpfr/root --build=mingw32 Thread model: win32 gcc version 4.4.0 (GCC)` – Isuru Ranawaka Sep 22 '13 at 10:19

0 Answers0