Using wxExecute and wxShell in Linux Debian.

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
fnsturgeon
In need of some credit
In need of some credit
Posts: 1
Joined: Wed Jan 03, 2018 3:54 pm

Using wxExecute and wxShell in Linux Debian.

Post by fnsturgeon »

I'm trying to run a console app from my gui app made with wxWidgets 3.02 64 bit.

I tried:

Code: Select all

wxExecute(_(“./prog1”), wxEXEC_ASYNC);

wxExecute(_(".\/prog1"), 1 | 2 | 4);
I tried with other combinations of the bit flags to no result.

I also tried putting the full executable path there. Same problem.

The console app is placed in the same folder than the main app.

I also tried using wxShell to open a terminal.
If I call it directly:

Code: Select all

wxShell()
It opens the terminal.
If I pass command, it fails.
I tried passing the command as wxString as a char, etc, etc.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Using wxExecute and wxShell in Linux Debian.

Post by DavidHart »

Hi,

You need to open a shell inside the wxExecute function. e.g.

Code: Select all

wxExecute("sh -c \"xterm -v | grep -q 271\"", wxEXEC_SYNC) 
BTW, you wrote:
_(“./prog1”)

_() marks a string as to be translated. I doubt if you want that there.

Regards,

David
Post Reply