Hello Thomas,

The error you have described typically indicates that a DLL could not be loaded
(in this case libgcc and libstdc++).  This can be easily resolved by adding the
directory containing these to the PATH variable prior to starting the program:

    set PATH=C:\MinGW64\bin;C:\MinGW64\x86_64-w64-mingw32\lib;%PATH%

Dependency Walker [1] is quite useful for diagnosing these types of problems.

Regards,

--Zaheer

[1]: http://www.dependencywalker.com/

On Sun, Jun 3, 2012 at 12:59 PM, Thomas Natschläger
<thomas.natschlae...@gmail.com> wrote:
> Hello!
>
> I'm a new to using MinGW64. I just tried to get a C++ style "Hello World"
> running but can not get it run. I'm running Windows 7 Home Premium 64bit on
> a Pentium(R) Dual Core CPU T4500@2.3GHz.
>
> I did the following:
>
> 1) Installed mingw-w64-bin_i686-mingw_20111220.zip (from
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Wi
> n64/Automated%20Builds/) under C:\MingGW64 which seems to work (see output
> of the command "C:\MinGW64\bin\x86_64-w64-mingw32-g++ -v --version" below)
>
> 2) Compile hw.cpp with the command "C:\MinGW64\bin\x86_64-w64-mingw32-g++ -v
> -o hw.cpp.exe hw.cpp" (see below for hw.cpp)
>
> 3) Run hw.cpp.exe : This gives a pop-up window which says that the
> application could not be started. Code 0xc000007b.
>
> 4) I tried a simple C (not C++) hello world (hw.c; see below):
>        Compile using "C:\MinGW64\bin\x86_64-w64-mingw32-g++ -v -o hw.c.exe
> hw.c"
>        ww.c.exe than says:
>            Hello World!
>            I'm a 64bit exe.
>
> 5) So my questions are:
>      What I'm doing wrong?
>      Is there a problem with libstdc++?
>      Any suggestions?
>
> Thanks for any help!
>
>     Thomas Natschläger
>
>
> ----------------------------------------------------------------------------
> -------------------------------
> hw.cpp
> ----------------------------------------------------------------------------
> -------------------------------
>
> #include <iostream>
> using namespace std;
> int main(int argc, char** argv) {
>        cerr << "Hello World" << endl;
>        cerr << "I'm a " << sizeof(void *)*8 << "bit exe." << endl;
> }
>
>
> ----------------------------------------------------------------------------
> -------------------------------
> hw.c
> ----------------------------------------------------------------------------
> -------------------------------
>
> #include <stdio.h>
> int main(int argc, char** argv) {
>        printf( "Hello World!\n" );
>        printf("I'm a %ibit exe.\n", sizeof(void *)*8 );
> }
>
>
> ----------------------------------------------------------------------------
> ------------------------------
> C:\MinGW64\bin\x86_64-w64-mingw32-g++ -v --version:
> ----------------------------------------------------------------------------
> -------------------------------
>
> x86_64-w64-mingw32-g++ (GCC) 4.7.0 20111220 (experimental)
> Copyright (C) 2011 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
>
> Using built-in specs.
> COLLECT_GCC=C:\MinGW64\bin\x86_64-w64-mingw32-g++
> COLLECT_LTO_WRAPPER=c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/l
> to-wrapper.exe
> Target: x86_64-w64-mingw32
> Configured with: ../../../build/gcc/src/configure
> --target=x86_64-w64-mingw32
> --prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root
> --with-sysroot=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root
> --enable-languages=all,obj-c++ --enable-fully-dynamic-string
> --disable-multilib
> Thread model: win32
> gcc version 4.7.0 20111220 (experimental) (GCC)
> COLLECT_GCC_OPTIONS='-v' '--version' '-shared-libgcc' '-mtune=generic'
> '-march=x86-64'
>  c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/cc1.exe -quiet -v
> -iprefix c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/ -U_REENTRANT
> help-dummy -quiet -dumpbase help-dummy -mtune=generic -march=x86-64 -auxbase
> help-dummy -version --version -o
> C:\Users\Thomas\AppData\Local\Temp\ccetFrxl.s
> GNU C (GCC) version 4.7.0 20111220 (experimental) (x86_64-w64-mingw32)
>        compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR version
> 2.4.2, MPC version 0.8.2
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> COLLECT_GCC_OPTIONS='-v' '--version' '-shared-libgcc' '-mtune=generic'
> '-march=x86-64'
>
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/bin/as.exe --version -o C:\Users\Thomas\AppData\Local\Temp\ccWQ6kFD.o
> C:\Users\Thomas\AppData\Local\Temp\ccetFrxl.s
> GNU assembler (GNU Binutils) 2.22.51.20111217
> Copyright 2011 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or later.
> This program has absolutely no warranty.
> This assembler was configured for a target of `x86_64-w64-mingw32'.
> COMPILER_PATH=c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/;c:/min
> gw64/bin/../libexec/gcc/;c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/
> ../../../../x86_64-w64-mingw32/bin/
> LIBRARY_PATH=c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/;c:/mingw64/
> bin/../lib/gcc/;c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../
> ../x86_64-w64-mingw32/lib/../lib/;c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw
> 32/4.7.0/../../../../x86_64-w64-mingw32/lib/
> COLLECT_GCC_OPTIONS='-v' '--version' '-shared-libgcc' '-mtune=generic'
> '-march=x86-64'
>  c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/collect2.exe
> --sysroot=c:/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root -m i386pep
> -Bdynamic --version
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/lib/../lib/crt2.o
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/lib/../lib/crtbegin.o
> -Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0
> -Lc:/mingw64/bin/../lib/gcc
> -Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-
> mingw32/lib/../lib
> -Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-
> mingw32/lib C:\Users\Thomas\AppData\Local\Temp\ccWQ6kFD.o -lmingw32 -lgcc_s
> -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
> -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/lib/../lib/crtend.o
> collect2 version 4.7.0 20111220 (experimental)
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/bin/ld.exe
> --sysroot=c:/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root -m i386pep
> -Bdynamic --version
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/lib/../lib/crt2.o
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/lib/../lib/crtbegin.o
> -Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0
> -Lc:/mingw64/bin/../lib/gcc
> -Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-
> mingw32/lib/../lib
> -Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-
> mingw32/lib C:\Users\Thomas\AppData\Local\Temp\ccWQ6kFD.o -lmingw32 -lgcc_s
> -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
> -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt
> c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mi
> ngw32/lib/../lib/crtend.o
> GNU ld (GNU Binutils) 2.22.51.20111217
> Copyright 2011 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) a later
> version.
> This program has absolutely no warranty.
>
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to