• Advertisement
Sign in to follow this  

Program Stopped Working (MinGW)

This topic is 1399 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is a very strange problem. I'm unit testing C-source files using a C++ testing framework (google test). For this to work, I've taken care of all the necessary "#ifdef __cplusplus, extern "C", #endif" statements in the C header files to satisfy the linker.

 

I'm using MinGW on a Windows 7 machine, gcc 4.7.2. The IDE I'm using is Code::Blocks.

 

The unit tests run perfectly fine if I build them from withing the IDE, but if I try to build them using make in the command line, upon executing the successfully built application, I get the error: "Test.exe has stopped working".

 

What could be causing this and how do I diagnose the error?

Share this post


Link to post
Share on other sites
Advertisement
There is a multitude of possible problems but I would probably start with ensuring all runtime dependencies of the program (starting with the C++ runtime) are available when using the command line.

Share this post


Link to post
Share on other sites

Try to reproduce the problem with an unoptimized build with debugging information (-O0 -g). If that works, run it under the debugger and see where it breaks.

Share this post


Link to post
Share on other sites

There is a multitude of possible problems but I would probably start with ensuring all runtime dependencies of the program (starting with the C++ runtime) are available when using the command line.

Yes, this was indeed the issue. libstdc++-6 was trying to be loaded, but was not in the path of the executable.

 

Thanks! I knew it was something simple.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement