Appcrash on execution

closed account (3hM2Nwbp)
Hello, thanks for taking the time to help.

_System_
O/S: Windows 7 Home Premium 64 bit
Compiler: minGW 5.1.6
IDE: Eclipse


_Problem_

I'm experiencing an AppCrash when trying to run the following Application:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
using std::cout;
using std::getchar;

#include "boost/asio.hpp"
using boost::asio::io_service;
using boost::asio::ip::tcp;

int main()
{
    io_service ios;
    cout << "Press any key to crash this application for some mysterious unknown reason...: ";
    cout.flush();
    getchar();
    tcp::acceptor* acceptor_ = new tcp::acceptor(ios, tcp::endpoint(tcp::v4(), 44444));
    return 0;
}



_What I've Tried_

* Spent literally days searching Google for a solution for this issue, unsuccessfully
* Obtained the latest version of Eclipse
* Obtained the latest 'stable' release of the boost library
* Confirmed that the call to the boost::asio::ip::tcp::acceptor constructor is where the crash is occurring.


_Other Notes_

* I just lay code as a hobby, so I'm really do not have a mastery understanding of the GNU compiler, eclipse, or the inner workings of the C linker, etc...I was just hoping that I could type some code, hit compile, and run it, but as I've learned with C++ in general, I spend 98% of the time trying to get the developer tools (IDE/Compiler/Linker) configured to the point where it will actually work and 2% actually programming. I used to do a lot of Java based programming, and never had any issues with the compiling system. Am I missing something, because I can hardly believe such a language as C++ wouldn't have better development tools.

* I really do not want to run this inside a debugger to find out what's wrong and fix a 'standard' library such as boost to get it to work especially for my system.

* I suppose that if there isn't a solution to this issue, I might as well just reinvent the wheel to have something that will actually run on my system.


_Closing_

Once again, thanks to anyone who is willing to help me get this figured out.

Best regards,
Luc
Did you check that your calls to Boost actually make sense? I.e. did you RTM?
Boost is probably throwing an exception about parameters not making sense and your code isn't catching it, so the result is the system killing your program.

with C++ in general, I spend 98% of the time trying to get the developer tools (IDE/Compiler/Linker) configured to the point where it will actually work and 2% actually programming.
Either you're using an incredibly complex set of libraries, or a small set of libraries to write many hundred-liners. The only time I spent considerably more time setting up the compilation environment was when I was compiling libVLC from source, which involved separately compiling around twenty libraries.
I don't really know what else to tell you. If I'm starting a new project that uses libraries I've used before, which is 90% of the time, it rarely takes me more than one or two minutes to get the compiler set up. You probably just need more practice.
closed account (3hM2Nwbp)
Thanks for the reply, Helios. I forgot to mention that the code compiles, links, and runs perfectly using the Microsoft compiler in visual studio (using the boost libraries built with BJam for MS). However, (using the libraries built with BJam for the GNU compiler in eclipse), it always crashes. The reason that I switched from the Visual Studio IDE was that as my project grew to ~40 classes, their auto-completion service was almost completely non-responsive. Again, searching Google for that specific issue did not turn up any working results either.

As I've said, I consider myself by no means to be a professional, let alone above average programmer; so configuration, and obtaining versions of tools that will work with each-other is still a large issue for me.

Best regards,
Luc

*Edit*
Thanks for the idea of using a try-catch block Helios - it seems that my application is suffering from a corruption in the Winsock library - which I haven't searched Google for at all yet. I am marking this topic as solved for now, as I have a new direction to search for a solution in.

Many thanks!
Last edited on
MinGW isn't really the best option for Boost. They don't really get along, and I've had some bad experiences with past versions of MinGW generating incorrect code from correct code. I'm not saying MinGW is unusable, I'm just saying that if code that was valid under VC++ crashes under MinGW, I'd suspect of MinGW.

The reason that I switched from the Visual Studio IDE was that as my project grew to ~40 classes, their auto-completion service was almost completely non-responsive.
That's odd. I'm using VC++ 2008 with a project containing 139 classes, not counting third party symbols (of which there are many), and the IDE runs smoothly.
Occasionally, IntelliSense gets a brain fart, but you can make it snap out of it by deleting its database (.nbc) when it happens.
Last edited on
helios wrote:
I'm using VC++ 2008 with a project containing 139 classes

Just curious, what is this about?
It's a 2D engine. The hugeness comes from all the things that need to be kept track of (files, archives, abstract streams, caches, audio, surfaces, graphical elements, linguistic elements, user state). You wouldn't believe the size of the interpreter class.
Topic archived. No new replies allowed.