Code: Select all
wxImage image;
image.LoadFile(wxT("a_file.png"));
Code: Select all
wxInitAllImageHandlers();
wxImage image;
image.LoadFile(wxT("/home/a/Επιφάνεια εργασίας/163.png"));
Thank you.
Jim
Code: Select all
wxImage image;
image.LoadFile(wxT("a_file.png"));
Code: Select all
wxInitAllImageHandlers();
wxImage image;
image.LoadFile(wxT("/home/a/Επιφάνεια εργασίας/163.png"));
There is no problem with libpng because i have the exaxt same code using wxWidgets-3.0.5 and there is no problem.The compiler very likely has no say in this, the error comes either from wxWidgets or libpng (I assume that on Linux you use the system libpng, not the one shipped with wxWidgets).
Never have problem with that, because the crashes happens only with png files.Are you sure the path encoding is not the issue, i.e., does it still crash even when the path contains only 7-bit ASCII characters or you pass the string you obtained e.g. from wxFileDialog::GetFileName()?
If there is the wxInitAllImageHandlers(); process terminated with status -1 (0 minute(s), 0 second(s))Anyway, you should step into the code and see where exactly (if not why) it crashes or at least get the crash stack call list from the debugger.
Well, this is expected. If no image handler is found then the file format is not recognized and that's it. Otherwise the crash comes from the image handler code when loading the file.
There is no image attached (except a rather useless screenshot of the error).
Code: Select all
wxInitAllImageHandlers();
wxImage image;
image.LoadFile(wxT("/home/a/163.png"));
I have send the image and call stack image............
[debug][Thread debugging using libthread_db enabled]
[debug]Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Child process PID: 7697
[debug][New Thread 0x7fffeabe0700 (LWP 7697)]
[debug][New Thread 0x7fffea3df700 (LWP 7698)]
[debug]32 ../setjmp/longjmp.c: Δεν υπάρχει τέτοιο αρχείο ή κατάλογος.
[debug]Thread 1 "la" received signal SIGSEGV, Segmentation fault.
[debug]__longjmp_chk (env=0x0, val=1) at ../setjmp/longjmp.c:32
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Stack level 0, frame at 0x7fffffffd740:
[debug] rip = 0x7ffff3907fa0 in __longjmp_chk (../setjmp/longjmp.c:32); saved rip = 0xa6c600
[debug] called by frame at 0x7fffffffd750
[debug] source language c.
[debug] Arglist at 0x7fffffffd720, args: env=0x0, val=1
[debug] Locals at 0x7fffffffd720, Previous frame's sp is 0x7fffffffd740
[debug] Saved registers:
[debug] rbx at 0x7fffffffd728, rbp at 0x7fffffffd730, rip at 0x7fffffffd738
[debug]>>>>>>cb_gdb:
Cannot open file: ../setjmp/longjmp.c
At ../setjmp/longjmp.c:32
I don’t know how to check that.Did you at least verify that applications using 3.0.5 and 3.1.4 use the exact same version of libpng?
I have put the code bellow but nothing ...Just to be sure, did you try if the crash happens also when loading image with the image sample?
Code: Select all
// In your App class that derived from wxApp
void myProject::OnUnhandledException()
{
try
{
throw;
}
catch(std::exception &e)
{
wxMessageBox( e.what(),"C++ Exception Caught",wxCENTER);
}
return ; // continue on. Return false to abort program
}
bool myProject::OnExceptionInMainLoop()
{
try
{
throw;
}
catch(std::exception &e)
{
wxMessageBox( e.what(),"C++ Exception Caught",wxCENTER);
}
return true; // continue on. Return false to abort program
}