If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
I tested this. First, in the line:
if(!output.IsEmpty() && errors.isEmpty())
the isEmpty needs an initial I, not i.
It then failed to give an output. I'm using debian as non-root, so /sbin/ isn't in my $PATH. It worked if I hard-coded /sbin/ifconfig.
However that gave the expected result: 192:168:0:2, which is the local IP address of this machine. Was that your intention? I suspect most people reading the topic title will have been expecting to see the IP address supplied by their ISP. AFAIK it's not possible to obtain that without looking outside the box.
Which? To get the local address? If so, I suggest you alter the topic's title to say that.
I used that with lUbuntu, and opensuse and the result was ok ...
It is for me with ubuntu too, but in openSUSE 42.1 typing 'ifconfig' in a terminal gives: Absolute path to ifconfig is /sbin/ifconfig, so running it may require superuser privileges (eg. root).
Typing /sbin/ifconfig worked OK though.
Perhaps your code should check if /sbin/ is in the $PATH and, If not, use the filepath rather than the filename. Or, better, always use /sbin/ifconfig if it exists.
shows PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
(default installation no manual additon to the PATH ...)
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.