Benoît Dubreuil
Benoît Dubreuil

Reputation: 680

MinGW 64 bit simple application error

I have just downloaded MinGW 64 bit for Windows (I'm not quite used to Linux) on http://sourceforge.net/projects/mingw-w64/?source=dlp When I compile the following code, I get no errors:

#include <iostream>
int main()
{
    std::cout << "Code 64 bit :D !" << std::endl;
    return 0;
}

Also, when I execute the program in Code::Blocks, eveything works perfectly (using cb_console_runner.exe). The problem occurs when I execute my program outside Code::Blocks. I get the error "The application couldn't start properly (0xc000007b)". By the way, I translated the error from french. Do you have any idea what is the problem or how I can debug this? Oh I forgot: I don't get any errors when code is empty (i.e. when int main(){return0;}).

Thank you!

Upvotes: 1

Views: 940

Answers (1)

Mark Nunberg
Mark Nunberg

Reputation: 3691

I've seen this happen here and there when GCC's standard C++ library (libstdc++) (or libgcc as well) is not in your %PATH%. Furthermore, this may also be the case that you have a mismatched version (i.e. a 32 bit version) of the same DLL in your path. Use something like Dependency Walker to determine this.

This doesn't happen when your program is empty since you are not using any symbols from the standard C++ library and thus it is not linked with your application. However when you use std::cout that references a symbol defined in the C++ library and thus it must be linked.

Upvotes: 3

Related Questions