Console application doesn't stop in ubuntu Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Console application doesn't stop in ubuntu

Post by zhouhao » Mon May 05, 2008 5:55 am

The wxwidgets console application doesn't stop in Ubuntu. I comments out everything except a simple wx include, the program sill doesn't stop. Here is my code:

Code: Select all

#include <wx/app.h>

int main(int argc,char* argv[])
{

  return 0;
}

If I comments out #include <wx/app.h>, everything is fine. Any suggestion?

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Mon May 05, 2008 2:38 pm

Usually wxWidgets apps use wxApp and its IMPLEMENT* and DECLARE* macros, i'm pretty sure you'll need to use one of them if you use wx in your app

vdell
Moderator
Moderator
Posts: 536
Joined: Fri Jan 07, 2005 3:44 pm
Location: Finland
Contact:

Post by vdell » Mon May 05, 2008 5:52 pm

Haven't tried it but the following can be found from the "console" sample:

Code: Select all

wxInitializer initializer;
if ( !initializer )
{
    fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
    return -1;
}
Visual C++ 9.0 / Windows XP Pro SP3 / wxWidgets 2.9.0 (SVN) | Colligere

zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Post by zhouhao » Tue May 06, 2008 6:04 am

vdell wrote:Haven't tried it but the following can be found from the "console" sample:

Code: Select all

wxInitializer initializer;
if ( !initializer )
{
    fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
    return -1;
}
I know these codes. I've purposely comments them out because of the problem. Thank you for your reply anyway.

zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Post by zhouhao » Tue May 06, 2008 7:10 am

I know where the problem come from. I linked to a shared library testshared-debug.so. After I remove the linked library, everything is back to normal. But I'm confused. Here are my questions:

1. Why does this shared library affect my program? I don't use any function from it.
2. Why the linked shared library will affect execution of my program? Because of memory leak?

zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Post by zhouhao » Thu May 08, 2008 4:58 am

The problem is I don't have a way to debug it. When I run the program in debug mode, it always stop at "return 0".

zhouhao
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2005 7:02 am

Post by zhouhao » Mon May 12, 2008 2:08 am

There is no problem if I use back version 2.8.7.

Post Reply