Why is g++ not producing a binary? - c++

This is my build log when using Eclipse and GCC.
I have tried every suggestion for this issue I have found on the web (and there are lots!) but nothing works for me.
Can anyone see any issue from this build log please:
17:49:24 **** Rebuild of configuration Debug for project test2 ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -v -o "src\\test2.o" "..\\src\\test2.cpp"
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\g++.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --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-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gmp-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)
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\test2.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1plus.exe -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.8.1/ -dD ..\src\test2.cpp -quiet -dumpbase test2.cpp -mtune=generic -march=pentiumpro -auxbase-strip src\test2.o -g3 -O0 -Wall -version -fmessage-length=0 -o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cc2tQ3YT.s
GNU C++ (GCC) version 4.8.1 (mingw32)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++/mingw32"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include/c++/backward"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../../../../include"
ignoring duplicate directory "/mingw/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/include-fixed"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++/mingw32
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include/c++/backward
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
End of search list.
GNU C++ (GCC) version 4.8.1 (mingw32)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1ebc2a6f92fbd3aadc367a20a63fdf9f
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\test2.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v -o src\test2.o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cc2tQ3YT.s
GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../
COLLECT_GCC_OPTIONS='-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src\test2.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
17:49:24 Build Finished (took 313ms)

Related

G++ not understanding console option

So, I need to compile, assemble, and link a C++ file. But, I need to use an external library with it. So, I'm attempting to do so with G++ using this batch file:
g++ -c WindowTest.cpp -I include\bgfx-master\include\bgfx -I include\glfw-3.3.8.bin.WIN32\include\GLFW --verbose
g++ WindowTest.o -o WindowTest.exe -static -L include\glfw-3.3.8.bin.WIN32\lib-vc2022 -l glfw3.lib --verbose
However, when run, I get this output:
g++ -c WindowTest.cpp -I include\bgfx-master\include\bgfx -I include\glfw-3.3.8.bin.WIN32\include\GLFW --verbose
Using built-in specs.
COLLECT_GCC=g++
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
COLLECT_GCC_OPTIONS='-c' '-I' 'include\bgfx-master\include\bgfx' '-I' 'include\glfw-3.3.8.bin.WIN32\include\GLFW' '-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/cc1plus.exe -quiet -v -I include\bgfx-master\include\bgfx -I include\glfw-3.3.8.bin.WIN32\include\GLFW -iprefix c:\mingw\bin\../lib/gcc/mingw32/6.3.0/ WindowTest.cpp -quiet -dumpbase WindowTest.cpp -mtune=generic -march=i586 -auxbase WindowTest -version -o C:\Users\owenr\AppData\Local\Temp\ccnfsknd.s
GNU C++14 (MinGW.org GCC-6.3.0-1) version 6.3.0 (mingw32)
compiled by GNU C version 6.3.0, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.2, isl version 0.15
warning: MPC header version 1.0.2 differs from library version 1.0.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include/c++"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include/c++/mingw32"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include/c++/backward"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include"
ignoring duplicate directory "/mingw/lib/gcc/mingw32/6.3.0/../../../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include-fixed"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/../../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
include\bgfx-master\include\bgfx
include\glfw-3.3.8.bin.WIN32\include\GLFW
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include/c++
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include/c++/mingw32
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include/c++/backward
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/../../../../include
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include-fixed
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/../../../../mingw32/include
End of search list.
GNU C++14 (MinGW.org GCC-6.3.0-1) version 6.3.0 (mingw32)
compiled by GNU C version 6.3.0, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.2, isl version 0.15
warning: MPC header version 1.0.2 differs from library version 1.0.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: af09a87986453bf79da3565f33c7648f
COLLECT_GCC_OPTIONS='-c' '-I' 'include\bgfx-master\include\bgfx' '-I' 'include\glfw-3.3.8.bin.WIN32\include\GLFW' '-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/as.exe -v -I include\bgfx-master\include\bgfx -I include\glfw-3.3.8.bin.WIN32\include\GLFW -o WindowTest.o C:\Users\owenr\AppData\Local\Temp\ccnfsknd.s
GNU assembler version 2.28 (mingw32) using BFD version (GNU Binutils) 2.28
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/6.3.0/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../
COLLECT_GCC_OPTIONS='-c' '-I' 'include\bgfx-master\include\bgfx' '-I' 'include\glfw-3.3.8.bin.WIN32\include\GLFW' '-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
$-> g++ WindowTest.o -o WindowTest.exe -static -L include\glfw-3.3.8.bin.WIN32\lib-vc2022 -l glfw3.lib --verbose
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/6.3.0/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../
COLLECT_GCC_OPTIONS='-o' 'WindowTest.exe' '-static' '-Linclude\glfw-3.3.8.bin.WIN32\lib-vc2022' '-v' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/collect2.exe -plugin c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/liblto_plugin-0.dll -plugin-opt=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\owenr\AppData\Local\Temp\ccyUGRgT.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -Bstatic -o WindowTest.exe c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/6.3.0/crtbegin.o -Linclude\glfw-3.3.8.bin.WIN32\lib-vc2022 -Lc:/mingw/bin/../lib/gcc/mingw32/6.3.0 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../.. WindowTest.o -lglfw3.lib -lstdc++ -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/6.3.0/crtend.o
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lglfw3.lib
collect2.exe: error: ld returned 1 exit status
I've tried moving the library file, adding or removing space between the -l option and glfw3.lib, and many other things. It gives this output every time unless I just don't try to include the library file, in which case I get this error:
WindowTest.o:WindowTest.cpp:(.text+0xc): undefined reference to `glfwInit'
collect2.exe: error: ld returned 1 exit status
Edit:
Here's the file system
Main Directory:
include
glfw-3.3.8.bin.WIN32
include
glw3.h (Header file included in WindowTest.cpp)
lib-vc2022
glfw3.lib (Library file I want to include)
WindowTest.cpp
MakeFile.bat (Has g++ commands)

mingw-w64 g++ terminates unexpectly during the compilation of wxWidgets

I used cmake to generate MinGW makefiles to compile wxWidgets. An error was occurred during the process of make (with VERBOSE=1):
[ 12%] Building CXX object libs/base/CMakeFiles/base.dir/__/__/__/src/common/appbase.cpp.obj
cd /d C:\Users\frank\Documents\Codes\wxWidgets\cmakebuild\libs\base && C:\PROGRA~1\MinGW\bin\G__~1.EXE -DDLL_EXPORTS -DUNICODE -DWXBUILDING -DWXDLLNAME=wxbase311u_gcc_custom -DWXMAKINGDLL_BASE -DWX_PRECOMP -D_LIB -D_UNICODE -D__WXMSW__ -Dbase_EXPORTS -DwxUSE_BASE=1 -DwxUSE_GUI=0 #CMakeFiles/base.dir/includes_CXX.rsp -Winvalid-pch -include "C:/.../cmakebuild/libs/base/cotire/base_CXX_prefix.hxx" -o CMakeFiles\base.dir\__\__\__\src\common\appbase.cpp.obj -c C:\Users\frank\Documents\Codes\wxWidgets\src\common\appbase.cpp
make[2]: *** [libs\base\CMakeFiles\base.dir\build.make:93: libs/base/CMakeFiles/base.dir/__/__/__/src/common/appbase.cpp.obj] Error 1
make[2]: Leaving directory 'C:/.../cmakebuild'
make[1]: *** [CMakeFiles\Makefile2:469: libs/base/CMakeFiles/base.dir/all] Error 2
make[1]: Leaving directory 'C:/.../cmakebuild'
make: *** [Makefile:129: all] Error 2
(I've replaced the wxWidgets source path to ...)
I re-ran the the command:
C:\PROGRA~1\MinGW\bin\G__~1.EXE -DDLL_EXPORTS -DUNICODE -DWXBUILDING -DWXDLLNAME=wxbase311u_gcc_custom -DWXMAKINGDLL_BASE -DWX_PRECOMP -D_LIB -D_UNICODE -D__WXMSW__ -Dbase_EXPORTS -DwxUSE_BASE=1 -DwxUSE_GUI=0 #CMakeFiles/base.dir/includes_CXX.rsp -Winvalid-pch -include "C:/.../cmakebuild/libs/base/cotire/base_CXX_prefix.hxx" -o CMakeFiles\base.dir\__\__\__\src\common\appbase.cpp.obj -c C:\...\src\common\appbase.cpp
But I received no output. I appended -v after the command, and here is the output:
Using built-in specs.
COLLECT_GCC=C:\PROGRA~1\MinGW\bin\G__~1.EXE
Target: x86_64-w64-mingw32
Configured with: ../src/configure --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multilib --prefix=/c/temp/gcc/dest --with-sysroot=/c/temp/gcc/dest --disable-libstdcxx-pch --disable-libstdcxx-verbose --disable-nls --disable-shared --disable-win32-registry --with-tune=haswell --enable-threads=posix --enable-libgomp
Thread model: posix
gcc version 7.3.0 (GCC)
COLLECT_GCC_OPTIONS='-D' 'DLL_EXPORTS' '-D' 'UNICODE' '-D' 'WXBUILDING' '-D' 'WXDLLNAME=wxbase311u_gcc_custom' '-D' 'WXMAKINGDLL_BASE' '-D' 'WX_PRECOMP' '-D' '_LIB' '-D' '_UNICODE' '-D' '__WXMSW__' '-D' 'base_EXPORTS' '-D' 'wxUSE_BASE=1' '-D' 'wxUSE_GUI=0' '-I' 'C:/.../cmakebuild/lib/gcc_dll/mswu' '-I' 'C:/.../include' '-I' 'C:/.../src/zlib' '-I' 'C:/.../src/regex' '-Winvalid-pch' '-include' 'C:/.../cmakebuild/libs/base/cotire/base_CXX_prefix.hxx' '-o' 'CMakeFiles\base.dir\__\__\__\src\common\appbase.cpp.obj' '-c' '-v' '-mtune=haswell' '-march=x86-64'
c:/progra~1/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/7.3.0/cc1plus.exe -quiet -v -I C:/.../cmakebuild/lib/gcc_dll/mswu -I C:/.../include -I C:/.../src/zlib -I C:/.../src/regex -iprefix c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/ -D_REENTRANT -D DLL_EXPORTS -D UNICODE -D WXBUILDING -D WXDLLNAME=wxbase311u_gcc_custom -D WXMAKINGDLL_BASE -D WX_PRECOMP -D _LIB -D _UNICODE -D __WXMSW__ -D base_EXPORTS -D wxUSE_BASE=1 -D wxUSE_GUI=0 -include C:/.../cmakebuild/libs/base/cotire/base_CXX_prefix.hxx C:\Users\frank\Documents\Codes\wxWidgets\src\common\appbase.cpp -quiet -dumpbase appbase.cpp -mtune=haswell -march=x86-64 -auxbase-strip CMakeFiles\base.dir\__\__\__\src\common\appbase.cpp.obj -Winvalid-pch -version -o C:\Users\frank\AppData\Local\Temp\ccF9vVx8.s
GNU C++14 (GCC) version 7.3.0 (x86_64-w64-mingw32)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/progra~1/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include/c++/7.3.0"
ignoring duplicate directory "c:/progra~1/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include/c++/7.3.0/x86_64-w64-mingw32"
ignoring duplicate directory "c:/progra~1/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include/c++/7.3.0/backward"
ignoring duplicate directory "c:/progra~1/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/7.3.0/include"
ignoring nonexistent directory "C:/temp/gcc/destC:/temp/gcc/dest/lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include"
ignoring duplicate directory "c:/progra~1/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/7.3.0/include-fixed"
ignoring duplicate directory "c:/progra~1/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "C:/temp/gcc/dest/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
C:/.../cmakebuild/lib/gcc_dll/mswu
C:/.../include
C:/.../src/zlib
C:/.../src/regex
c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include/c++/7.3.0
c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include/c++/7.3.0/x86_64-w64-mingw32
c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../include/c++/7.3.0/backward
c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/include
c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/include-fixed
c:\progra~1\mingw\bin\../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C++14 (GCC) version 7.3.0 (x86_64-w64-mingw32)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 00ba9da796d75deb4f2564304e4a9551
I have no idea what the output above indicates, but if I replace -E instead of -c in the original command, it runs successfully. And if I compile the precompiled source file, it also runs successfully and produces the object file I want.
With this method I can produce the object files and make recognize them, but I can't do this manually for every single object file wxWidgets needs. What problem is this? Is there a way to fix it?
CMake version is 3.13.0-rc3
GNU Make version is 4.2.1
MinGW-W64 G++ version is 7.3.0

Cross-compiling for Raspberry Pi: can't find bits/c++config.h

I'm trying to setup a c++ 11 cross-compiler (version 4.9.2-r2) for the raspberry pi (Raspbian-jessie) on windows 7 x64.
I am working in CodeLite and I added the cross compiler under settings->build settings. I've also set the compiler as the one to use for my project.
The problem I am having is this error:
c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\4.9\iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
I searched on the internet for this problem but I am only finding people who are trying to cross compile for 64 bit linux on a 32 bit version or visa versa but nothing related to the Pi.
Edit 1:
As requested in the comments, this is the complete output when I compile with the -v option:
C:\Windows\system32\cmd.exe /C mingw32-make -e -f Makefile
"----------Building project:[ TestProject01 - Release ]----------"
mingw32-make[1]: Entering directory 'C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01'
Using built-in specs.
COLLECT_GCC=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++.exe
COLLECT_LTO_WRAPPER=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/lto-wrapper.exe
Target: arm-linux-gnueabihf
Configured with: ../gcc-4.9.2/src/configure --enable-win32-registry=SysGCC-arm-linux-gnueabihf-4.9.2 --prefix /q/gnu/linux/raspberry-jessie/out/ --disable-nls --without-libiconv-prefix --with-sysroot=/q/gnu/linux/raspberry-jessie/out/arm-linux-gnueabihf/sysroot --enable-languages=c,c++ --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --with-arch-directory=arm --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --target arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-std=c++11' '-O2' '-Wall' '-v' '-D' 'NDEBUG' '-I' '.' '-I' '.' '-MG' '-MP' '-MT' './Release/main.cpp.o' '-MF' './Release/main.cpp.o.d' '-MM' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/cc1plus.exe -E -quiet -v -I . -I . -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/ -isysroot c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot -MM -MF ./Release/main.cpp.o.d -MG -MP -MT ./Release/main.cpp.o -D_GNU_SOURCE -D NDEBUG main.cpp -march=armv6 -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -std=c++11 -Wall -O2
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9"
ignoring nonexistent directory "C:/MinGW/msys/1.0/include/arm-linux-gnueabihf/c++/4.9/."
ignoring nonexistent directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include"
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
ignoring duplicate directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf"
ignoring duplicate directory "."
#include "..." search starts here:
#include <...> search starts here:
.
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include
End of search list.
COMPILER_PATH=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/;c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../libexec/gcc/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/
LIBRARY_PATH=c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../lib/gcc/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/lib/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-std=c++11' '-O2' '-Wall' '-v' '-D' 'NDEBUG' '-I' '.' '-I' '.' '-MG' '-MP' '-MT' './Release/main.cpp.o' '-MF' './Release/main.cpp.o.d' '-MM' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++.exe -c "C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01/main.cpp" -std=c++11 -O2 -Wall -v -DNDEBUG -o ./Release/main.cpp.o -I. -I.
Using built-in specs.
COLLECT_GCC=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++.exe
Target: arm-linux-gnueabihf
Configured with: ../gcc-4.9.2/src/configure --enable-win32-registry=SysGCC-arm-linux-gnueabihf-4.9.2 --prefix /q/gnu/linux/raspberry-jessie/out/ --disable-nls --without-libiconv-prefix --with-sysroot=/q/gnu/linux/raspberry-jessie/out/arm-linux-gnueabihf/sysroot --enable-languages=c,c++ --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --with-arch-directory=arm --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --target arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-c' '-std=c++11' '-O2' '-Wall' '-v' '-D' 'NDEBUG' '-o' './Release/main.cpp.o' '-I' '.' '-I' '.' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/cc1plus.exe -quiet -v -I . -I . -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/ -isysroot c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot -D_GNU_SOURCE -D NDEBUG C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01/main.cpp -quiet -dumpbase main.cpp -march=armv6 -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -auxbase-strip ./Release/main.cpp.o -O2 -Wall -std=c++11 -version -o C:\Users\Peter\AppData\Local\Temp\ccjXLoID.s
GNU C++ (GCC) version 4.9.2 (arm-linux-gnueabihf)
compiled by GNU C version 4.8.1, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9"
ignoring nonexistent directory "C:/MinGW/msys/1.0/include/arm-linux-gnueabihf/c++/4.9/."
ignoring nonexistent directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include"
ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf/arm-linux-gnueabihf"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed"
ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
ignoring duplicate directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf"
ignoring duplicate directory "."
#include "..." search starts here:
#include <...> search starts here:
.
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf
c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include
End of search list.
GNU C++ (GCC) version 4.9.2 (arm-linux-gnueabihf)
compiled by GNU C version 4.8.1, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 77a52a28e20292d776f27f30cc5b625f
In file included from C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01/main.cpp:2:0:
c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\4.9\iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
mingw32-make[1]: *** [Release/main.cpp.o] Error 1
TestProject01.mk:97: recipe for target 'Release/main.cpp.o' failed
mingw32-make[1]: Leaving directory 'C:/Users/Peter/Downloads/THO6/github_repo/product/test_product/TestProject/TestProject01'
mingw32-make: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====2 errors, 1 warnings====

configure gdb 7.7.1 and brew install gcc-4.8 in eclipse makefile project

I just installed gdb 7.7.1 and gcc 4.8.3 by brew on my mac 10.9.4, it does well when I use gcc to compile a test.cpp and use gdb to debug it; but I cannot configure my IDE eclipse cdt to do it? The following is the output and my configure on eclipse?
gcc ouptput when compile in terminal:
wens#mac-pro:test$ g++ -g -std=c++11 -v test.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple- darwin13.3.0/4.8.3/lto-wrapper
Target: x86_64-apple-darwin13.3.0
Configured with: ../configure --build=x86_64-apple-darwin13.3.0 -- prefix=/usr/local/Cellar/gcc48/4.8.3 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.3' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc48 4.8.3)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/cc1plus -quiet -v -D__DYNAMIC__ test.cpp -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase test.cpp -mmacosx-version-min=10.9.3 -mtune=core2 -auxbase test -g -std=c++11 -version -o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccnjAUQK.s
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/include"
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple- darwin13.3.0/4.8.3/../../../../x86_64-apple-darwin13.3.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/x86_64-apple-darwin13.3.0
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/backward
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include
/usr/local/include
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ef96a7cbf8b02312d9306455464399f1
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-shared-libgcc' '-mtune=core2'
as -arch x86_64 -force_cpusubtype_ALL -o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccvxLrmP.o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccnjAUQK.s
COMPILER_PATH=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple- darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/
LIBRARY_PATH=/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-shared-libgcc' '-mtune=core2' /usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple darwin13.3.0/4.8.3/collect2 -dynamic -arch x86_64 -macosx_version_min 10.9.3 -weak_reference_mismatches non-weak -o a.out -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3 -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../.. /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccvxLrmP.o -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v -idsym -dsym
collect2 version 4.8.3
/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.9.3 -weak_reference_mismatches non-weak -o a.out -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3 -L/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../.. /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccvxLrmP.o -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
#(#)PROGRAM:ld PROJECT:ld64-236.4
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
Library search paths:
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3
/usr/local/Cellar/gcc48/4.8.3/lib
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
dsymutil a.out
This output "a.out" and " a.out.dSYM" is just like native clang, and I can use gdb debug it correctly.
The following is the output from eclipse:
18:02:32 **** Build of configuration Default for project test ****
make all
/usr/local/bin/g++ -g -std=c++11 -v -c -o test.o test.cpp
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
Target: x86_64-apple-darwin13.3.0
Configured with: ../configure --build=x86_64-apple-darwin13.3.0 -- prefix=/usr/local/Cellar/gcc48/4.8.3 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.3' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc48 4.8.3)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-c' '-o' 'test.o' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/cc1plus -quiet -v -D__DYNAMIC__ test.cpp -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase test.cpp -mmacosx-version-min=10.9.3 -mtune=core2 -auxbase-strip test.o -g -std=c++11 -version -o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccJWTQT8.s
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/include"
ignoring nonexistent directory "/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple- darwin13.3.0/4.8.3/../../../../x86_64-apple-darwin13.3.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/x86_64-apple-darwin13.3.0
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include/c++/backward
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include
/usr/local/include
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C++ (Homebrew gcc48 4.8.3) version 4.8.3 (x86_64-apple-darwin13.3.0)
compiled by GNU C version 4.8.3, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ef96a7cbf8b02312d9306455464399f1
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-c' '-o' 'test.o' '-shared-libgcc' '-mtune=core2'
as -arch x86_64 -force_cpusubtype_ALL -o test.o /var/folders/8j/2cdrpyn133v4mvc7x65b6c040000gn/T//ccJWTQT8.s
COMPILER_PATH=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin13.3.0/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/
/usr/local/bin/g++ -o test test.o
LIBRARY_PATH=/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/:/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin13.3.0/4.8.3/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-g' '-std=c++11' '-v' '-c' '-o' 'test.o' '-shared-libgcc' '-mtune=core2'
18:02:32 Build Finished (took 415ms)
The config in the tiny test makefile c++ project
CXX = /usr/local/bin/g++
CXXFLAGS = -mmacosx-version-min=10.9.3 -g -std=c++11 -v -shared-libgcc -mtune=core2
OBJS = test.o
LIBS =
TARGET = test
$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
when i use gdb print a local value in main(), it give following:
(gdb) r
(gdb) file test
Reading symbols from test...done.
(gdb) list
8 #include <iostream>
9 #include <vector>
10
11 using namespace std;
12
13 //extern vector<int> spiral_output_matrix(vector<vector<int> > const &v);
14
15 int main()
16 {
17 vector<int> origin = {1, 3, 5};
(gdb) break 20
Breakpoint 1 at 0x100000810: file test.cpp, line 20.
(gdb) run
Starting program: /Users/wens/Desktop/code_study/eclipse/test/test
Breakpoint 1, main () at test.cpp:21
21 for (auto i : origin)
(gdb) print i
Could not find the frame base for "main()".
(gdb)
I have used the same gcc-4.8 and gdb 7.7.1 for eclipse, from the above output I can know it's something about ld and dsymutil? It cause the different, right? anyone can tell me is there some way to configure eclipse to do this?

Can't link BOTAN library with eclipse

I have installed and built the BOTAN cryptographic library.
Everything seems correctly installed, since I have the following entries in /usr/local/lib directory:
-rw-r--r-- 1 root root 7676350 2012-06-03 11:01 libbotan-1.10.a
lrwxrwxrwx 1 root root 20 2012-06-03 11:01 libbotan-1.10.so -> libbotan-1.10.so.0.1
lrwxrwxrwx 1 root root 20 2012-06-03 11:01 libbotan-1.10.so.0 -> libbotan-1.10.so.0.1
-rwxr-xr-x 1 root root 3396354 2012-06-03 11:01 libbotan-1.10.so.0.1
and in the /usr/local/include one too:
drwxr-xr-x 3 root root 4096 2012-06-03 11:01 botan-1.10
And eventually I managed to include the libraries in the main of my program, and write code without error.
However when building my project (on Eclipse Indigo) I get the following output on console, with the red stderr fashion:
error while loading shared libraries: libbotan-1.10.so.0: cannot open shared object file: No such file or directory
The code I'm trying to execute is the following:
try
{
cout << "In try" << endl;
Botan::LibraryInitializer init;
}catch(std::exception& e)
{
cout << "In catch" << endl;
cerr << e.what() << endl;
}
I have the following doubts:
Is it a problem of the Linker? (And if yes, why isn't the linker throwing the error, but the stderr?)
If not, how can I figure out to let my program find the libbotan-1.10.so.0 file which is actually there? (in /usr/local/lib).
Note that my environment variable $LD_LIBRARY_PATH is currently set, and has the following value:
$> echo $LD_LIBRARY_PATH
$> /usr/local/lib/
Compiler Command Line:
Invoking: GCC C++ Compiler
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"mainOobClient.d" -MT"mainOobClient.d" -o "mainOobClient.o" "../mainOobClient.cpp"
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"oobClientClass.d" -MT"oobClientClass.d" -o "oobClientClass.o" "../oobClientClass.cpp"
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o "MTVS_oobClient" ./mainOobClient.o ./oobClientClass.o -lbotan-1.10
Complete Build Output:
Build of configuration Debug for project MTVS_oobClient
make all
Building file: ../mainOobClient.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"mainOobClient.d" -MT"mainOobClient.d" -o "mainOobClient.o" "../mainOobClient.cpp"
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
Finished building: ../mainOobClient.cpp
Building file: ../oobClientClass.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -O3 -g3 -Wall -c -fmessage-length=0 -std=c++0x -v -MMD -MP -MF"oobClientClass.d" -MT"oobClientClass.d" -o "oobClientClass.o" "../oobClientClass.cpp"
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFmainOobClient.d' '-MTmainOobClient.d' '-o' 'mainOobClient.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/cc1plus -quiet -v -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -MMD mainOobClient.d -MFmainOobClient.d -MP -MTmainOobClient.d -MQ mainOobClient.o -dD -D_GNU_SOURCE ../mainOobClient.cpp -D_FORTIFY_SOURCE=2 -quiet -dumpbase mainOobClient.cpp -mtune=generic -march=i686 -auxbase-strip mainOobClient.o -g3 -O3 -Wall -std=c++0x -version -fmessage-length=0 -fstack-protector -o /tmp/ccLIYQkV.s
Finished building: ../oobClientClass.cpp
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
Building target: MTVS_oobClient
Invoking: GCC C++ Linker
g++ ./mainOobClient.o ./oobClientClass.o -lbotan-1.10 -L/usr/local/lib -o "MTVS_oobClient"
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../../../i686-linux-gnu/include"
ignoring duplicate directory "/usr/include/c++/4.5.2"
as it is a non-system directory that duplicates a system directory
Finished building target: MTVS_oobClient
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/botan-1.10
/usr/include/c++/4.5
/usr/include/c++/4.5/i686-linux-gnu
/usr/include/c++/4.5/backward
/usr/local/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
/usr/include/i386-linux-gnu
/usr/include
End of search list.
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0c5cb630517b5952f4898dfa56d7e8e5
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFmainOobClient.d' '-MTmainOobClient.d' '-o' 'mainOobClient.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
as -V -Qy --32 -o mainOobClient.o /tmp/ccLIYQkV.s
GNU assembler version 2.21.0 (i686-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.21.0.20110327
COMPILER_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/:/usr/lib/i386-linux-gnu/
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFmainOobClient.d' '-MTmainOobClient.d' '-o' 'mainOobClient.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFoobClientClass.d' '-MToobClientClass.d' '-o' 'oobClientClass.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/cc1plus -quiet -v -I/usr/include/c++/4.5.2 -I/usr/local/include/botan-1.10 -MMD oobClientClass.d -MFoobClientClass.d -MP -MToobClientClass.d -MQ oobClientClass.o -dD -D_GNU_SOURCE ../oobClientClass.cpp -D_FORTIFY_SOURCE=2 -quiet -dumpbase oobClientClass.cpp -mtune=generic -march=i686 -auxbase-strip oobClientClass.o -g3 -O3 -Wall -std=c++0x -version -fmessage-length=0 -fstack-protector -o /tmp/ccTuqeWw.s
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../../../i686-linux-gnu/include"
ignoring duplicate directory "/usr/include/c++/4.5.2"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/botan-1.10
/usr/include/c++/4.5
/usr/include/c++/4.5/i686-linux-gnu
/usr/include/c++/4.5/backward
/usr/local/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
/usr/include/i386-linux-gnu
/usr/include
End of search list.
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (i686-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0c5cb630517b5952f4898dfa56d7e8e5
../oobClientClass.cpp: In member function ‘void oobClientClass::authenticateTransaction()’:
../oobClientClass.cpp:126:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
../oobClientClass.cpp:164:63: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result
../oobClientClass.cpp:59:6: warning: ‘confirmationChoice’ may be used uninitialized in this function
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFoobClientClass.d' '-MToobClientClass.d' '-o' 'oobClientClass.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
as -V -Qy --32 -o oobClientClass.o /tmp/ccTuqeWw.s
GNU assembler version 2.21.0 (i686-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.21.0.20110327
COMPILER_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/:/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/:/usr/lib/i386-linux-gnu/
COLLECT_GCC_OPTIONS='-I/usr/include/c++/4.5.2' '-I/usr/local/include/botan-1.10' '-O3' '-g3' '-Wall' '-c' '-fmessage-length=0' '-std=c++0x' '-v' '-MMD' '-MP' '-MFoobClientClass.d' '-MToobClientClass.d' '-o' 'oobClientClass.o' '-shared-libgcc' '-mtune=generic' '-march=i686'
**** Build Finished ****
The error is coming at run-time. You need to specify the rpath for the binary at build time - Where you have the:
-L/usr/local/lib
You also need:
-Wl,-rpath=/usr/local/lib
This instructs ld to use this path when trying to find the library at run-time. Your LD_LIBRARY_PATH is probably being overridden by the launcher of eclipse, which is why the variable is not being used.
Alternatives:
Make sure that /usr/local/lib is in the /etc/ld.so.conf, and that ldconfig has been run after installing the library.
Link to the .a, using the command line:
g++ -o "MTVS_oobClient" ./mainOobClient.o ./oobClientClass.o -L/usr/local/lib -Wl,-Bstatic -lbotan-1.10 -Wl,-Bdynamic
or using:
g++ -o "MTVS_oobClient" ./mainOobClient.o ./oobClientClass.o /usr/local/lib/libbotan-1.10.a
... both should have the same effect
Since the program build ends correctly, it is clear that it's a run-time problem due to the fact that the program can't find the Shared Library.
I looked for other people with same run-time issue and found out the solution (that I'll briefly sum up) thanks to another SO question.
What I did was to build the dynamically-linked executable, that wishes to be linked against libbotan-1.10.so.0 at execution time. The linking during the build phase was done with command line option -L/usr/local/lib.
There are a few options to make botan (or any other library) available at run-time:
Create a symlink to botan in a directory listed in /etc/ld.so.conf (or /lib or /usr/lib)
Copy botan to a directory listed in /etc/ld.so.conf (or /lib or /usr/lib) (defaults)
Add the directory containing botan to /etc/ld.so.conf
Set LD_LIBRARY_PATH=/usr/local/lib before running your executable.
Recompile the program statically. (It will work, but don't bother.)
After any of the first 3, rerun ldconfig so the linker cache is updated. (You can then run ldconfig -v to verify it's resolvable.)
Note those aren't steps, they're options. You only need to do 1 of them.
Updating the linker cache with ldconfig made it work for me.