C++ Eclipse generates invalid exe -
i using c++ eclipse , mingw/msys ecosystem compiling c++ programs. set correct paths mingw/msys in system variables. on building exe created name libtest says x86/le in format. when run exe below error :
createprocess error=193, %1 not valid win32 application
i used dependency walker on created exe , got below error
error: @ least 1 module has unresolved import due missing export function in implicitly dependent module. error: modules different cpu types found.
i attaching build log below :
**** build of configuration debug project test **** make -k building file: ../src/test.cpp invoking: gcc c++ compiler g++ -i"c:\mingw\include" -o0 -g3 -wall -c -fmessage-length=0 -v -mmd -mp -mf"src/test.d" -mt"src/test.d" -o"src/test.o" "../src/test.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='-i' 'c:\mingw\include' '-o0' '-g3' '-wall' '-c' '-fmessage-length=0' '-v' '-mmd' '-mp' '-mf' 'src/test.d' '-mt' 'src/test.d' '-o' 'src/test.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro' c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1plus.exe -quiet -v -i c:\mingw\include -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.8.1/ -mmd src/test.d -mf src/test.d -mp -mt src/test.d -dd ../src/test.cpp -quiet -dumpbase test.cpp -mtune=generic -march=pentiumpro -auxbase-strip src/test.o -g3 -o0 -wall -version -fmessage-length=0 -o c:\users\abc\appdata\local\temp\ccpn8rre.s gnu c++ (gcc) version 4.8.1 (mingw32) compiled 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" ignoring duplicate directory "c:\mingw\include" non-system directory duplicates system directory #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 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='-i' 'c:\mingw\include' '-o0' '-g3' '-wall' '-c' '-fmessage-length=0' '-v' '-mmd' '-mp' '-mf' 'src/test.d' '-mt' 'src/test.d' '-o' 'src/test.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v -i c:\mingw\include -o src/test.o c:\users\abc\appdata\local\temp\ccpn8rre.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='-i' 'c:\mingw\include' '-o0' '-g3' '-wall' '-c' '-fmessage-length=0' '-v' '-mmd' '-mp' '-mf' 'src/test.d' '-mt' 'src/test.d' '-o' 'src/test.o' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro' finished building: ../src/test.cpp building target: libtest.exe invoking: mingw c++ linker g++ -shared -o"libtest.exe" ./src/test.o finished building target: libtest.exe
it seems 32 bit libraries getting picked.
however if compile using command line correct exe getting generated.
it seems problem in using -shared
. -shared
dynamic link libraries (.dll
s) only. building application (.exe
) should not use it. (i talking last command in makefile: g++ -shared -o"libtest.exe" ./src/test.o
)
build
g++ -o "libtest.exe" ./src/test.o
Comments
Post a Comment