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 »

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 »

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
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 536
Joined: Fri Jan 07, 2005 3:44 pm
Location: Finland
Contact:

Post by vdell »

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 »

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 »

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 »

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 »

There is no problem if I use back version 2.8.7.
Post Reply