(Solved)Problems lauching .exe with QProcess
Hey guys this is my first time posting here. I’m writing a toolkit for a game i’m writing and I need to be able to launch the game itself from within the toolkit. I can launch any other program except the game. This is the code i’m using:
The error checking section actually prints running, although i cannot see the process in the task manager and nothing appears on the screen. The engine is written with SDL and OpenGL. I can launch it from the command line with no issues and I can launch any other program using QProcess so I can’t see any reason this wouldn’t work. If anyone could shed some light on the issue that would be great.
Edit: Also when i launch the .exe normally (by double clicking) it produces a command prompt which then opens the game window, I don’t know if this is relevant but I thought the first window may be timing out before the second is launched.
I don’t know if it is important, but why do you wrap the command path into quotes (”)? Also, forward slashes (/) should work too.
Regarding your addition:
- Could it be, that the exe cannot find some dependency? Seems as if it can be started but stops abnormally.
- Any data on stdout/stderr of the process?
- Is the new process still running when waitForStarted returns?
Thanks for the reply, the reason for the quotes is that some of the paths i was testing this code with had spaces and windows didn’t like that. There is no stdout/stderr produced which makes me think that the process doesn’t really run at all. I don’t think it’s because of dependencies if I can run it from the command line it should be ok. And to answer your last question, no it’s not still running. In fact there’s no way you could tell it started at all, it doesn’t appear in the task manager.