Qt program under linux problem
-
My code execute well under window 7, I transferred it to linux, complied under linux. All work seemed well, I can start the program from qt creator perfectly. But without the qt creator, my program wouldn't execute and no message . When I try to start it from console. finally I got a message "Segmentation falut" from console.
My question is what make my program can only started from qt creator. what should I do to make it can be started directly? (I create a simple MainWindow project, the MainWindow program can execute directly)If it is my code has problem? -
My program execute normally under window7. no matter from qt creator or directly. Under linux, from Qt creator debuging or not both can execute normally too.but cannot run directly by double click.When I try to run from console, I got the message segmantation fault.
-
[quote author="henryxuv" date="1344515461"]My program execute normally under window7. no matter from qt creator or directly. Under linux, from Qt creator debuging or not both can execute normally too.but cannot run directly by double click.When I try to run from console, I got the message segmantation fault.[/quote]
You need to debug under Linux then.
-
[quote author="henryxuv" date="1344517216"]when debugging everything is normal, I can't find any error. Is anybody met this kind of problem before?[/quote]
Assuming that you mean running the program with the debugger under linux.
If it runs in the debugger on linux, it may most likely run directly also under linux as long as you use the debug settings for compilation.
So, it could have something to do with the optimization of the compiler. You need to check with different optimization settings for compilation of your own application. -
... or with your environment. Maybe it fails to find some libraries (or picks up a wrong version somewhere). Check the run environment in Qt Creator and make sure LD_LIBRARY_PATH, PATH and others are sensible for your setup. Try just setting the values found in Creator before running your application.