From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4435 invoked by alias); 21 Aug 2011 04:19:42 -0000 Received: (qmail 4426 invoked by uid 22791); 21 Aug 2011 04:19:37 -0000 X-SWARE-Spam-Status: No, hits=2.4 required=5.0 tests=AWL,BAYES_00,TBC,TW_BJ,TW_JL,TW_LG,TW_YG X-Spam-Check-By: sourceware.org Received: from mail2.sea5.speakeasy.net (HELO mail2.sea5.speakeasy.net) (69.17.117.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 21 Aug 2011 04:19:16 +0000 Received: (qmail 14660 invoked from network); 21 Aug 2011 03:32:45 -0000 Received: from 24-113-112-30.wavecable.com (HELO [192.168.2.2]) (tomdean@[24.113.112.30]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 21 Aug 2011 03:32:45 -0000 Subject: Re: x86_64-w64-ming32-g++ file not recognized by objdump From: "Thomas D. Dean" Reply-To: tomdean@speakeasy.org To: cygwin@cygwin.com In-Reply-To: <40061A22EBC6455991351C55D9C2FD26@desktop2> References: <1313874009.16574.15.camel@asus> <40061A22EBC6455991351C55D9C2FD26@desktop2> Content-Type: text/plain; charset="UTF-8" Date: Sun, 21 Aug 2011 04:19:00 -0000 Message-ID: <1313897562.24758.31.camel@asus> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-08/txt/msg00398.txt.bz2 On Sun, 2011-08-21 at 12:09 +1000, Sisyphus wrote: Sorry for the Top post, with a related question. Maybe the correct question I should ask, is how to create a 64-bit executable with cygwin gcc 4.5.3? I think I am missing some environment variable that points to the correct dll to load????? > ----- Original Message ----- > From: "Thomas D. Dean" > > > #include > > #include > > using namespace std; > > int main() { > > vector vs; > > vs.push_back("asdf"); > > } > > > > > > If I compile with x86_64-w64-ming32-g++ -m64 t.cc -o t > > I presume the 'ming32' is a typo. > Is the '-m64' necessary ? I have cgywin installed. Along with it, came the 64-bit compiler The executable I attempted to use was /usr/bin/x86_64-w64-ming32-g++ the version is (GCC) 4.5.3 I discovered the 64 bit version of objdump - that produces something like what I expected for output. The problem I have seems to be in locating libstdc++, I think. If I compile a hello, world application, #include int main() { printf("Hello, world.\n"); return 0; } with x86_64-w64-ming32-g++ hello.c -o hello, it produces a 64-bit executable that runs Ok. cygcheck produces only the filename output for a 64-bit executable. > file ./hello.exe ./hello.exe: PE32+ executable (console) x86-64, for MS Windows If I compile the t.cc application needing libstdc++, the executable fails and the .exe produced is broken. Like, libstdc++ is not linked in. > x86_64-w64-ming32-g++ t.cc -o t > file ./t.exe t.exe: PE32+ executable (console) x86-64, for MS Windows > ./t.exe t.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory Building with verbose: > x86_64-w64-ming32-g++ -v t.cc -o t Using built-in specs. COLLECT_GCC=x86_64-w64-mingw32-g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: /home/user/June142011/gcc64/mingw64-x86_64-gcc-4.5.3-1/src/gcc-4.5.3/configure --srcdir=/home/user/June142011/gcc64/mingw64-x86_64-gcc-4.5.3-1/src/gcc-4.5.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/mingw64-x86_64-gcc -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=x86_64-w64-mingw32 --with-sysroot=/usr/x86_64-w64-mingw32/sys-root --with-build-sysroot=/usr/x86_64-w64-mingw32/sys-root --disable-multilib --disable-win32-registry --enable-languages=c,ada,c++,fortran,objc,obj-c++ --enable-fully-dynamic-strings --enable-libgomp --enable-sjlj-exceptions --enable-version-specific-runtime-libs --with-dwarf2 --enable-decimal-float=bid --enable-lto Thread model: win32 gcc version 4.5.3 (GCC) COLLECT_GCC_OPTIONS='-v' '-o' 't.exe' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/cc1plus.exe -quiet -v t.cc -quiet -dumpbase t.cc -mtune=generic -march=x86-64 -auxbase t -version -o /tmp/cc36xmDw.s GNU C++ (GCC) version 4.5.3 (x86_64-w64-mingw32) compiled by GNU C version 4.5.0, GMP version 4.3.1, MPFR version 2.4.1-p5, MPC version 0.8 warning: GMP header version 4.3.1 differs from library version 4.3.2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/x86_64-w64-mingw32/sys-root/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/include/c++ /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/include/c++/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/include/c++/backward /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/include /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/include-fixed /usr/x86_64-w64-mingw32/sys-root/mingw/include End of search list. GNU C++ (GCC) version 4.5.3 (x86_64-w64-mingw32) compiled by GNU C version 4.5.0, GMP version 4.3.1, MPFR version 2.4.1-p5, MPC version 0.8 warning: GMP header version 4.3.1 differs from library version 4.3.2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: b57d0d403a1834b1b129f166da9e071e COLLECT_GCC_OPTIONS='-v' '-o' 't.exe' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/as.exe -v -o /tmp/ccUf85Zh.o /tmp/cc36xmDw.s GNU assembler version 2.21.51 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.21.51.20110605 COMPILER_PATH=/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/:/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ LIBRARY_PATH=/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/:/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/lib/../lib64/:/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/lib/:/usr/x86_64-w64-mingw32/sys-root/mingw/lib/ COLLECT_GCC_OPTIONS='-v' '-o' 't.exe' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/collect2.exe --sysroot=/usr/x86_64-w64-mingw32/sys-root -m i386pep -Bdynamic -o t.exe /usr/x86_64-w64-mingw32/sys-root/mingw/lib/crt2.o /usr/x86_64-w64-mingw32/sys-root/mingw/lib/crtbegin.o -L/usr/lib/gcc/x86_64-w64-mingw32/4.5.3 -L/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/lib/../lib64 -L/usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/lib -L/usr/x86_64-w64-mingw32/sys-root/mingw/lib /tmp/ccUf85Zh.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt /usr/x86_64-w64-mingw32/sys-root/mingw/lib/crtend.o How do I link in libstdc++? tomdean -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple