On Fri, 2008-09-26 at 17:59 -0300, Paulo Flabiano Smorigo wrote:
> Hi everybody,
>
> I'm still trying to compile spawn_async_with_pipes on windows. Now I
> created a little source that can help to solve the problem.
>
> I use the following command to compile (using gtkmm for windows
> libraries):
> i586-mingw32msvc-g++ Player.cpp `pkg-config --cflags --libs gtkmm-2.4`
> -o app.exe
>
> The code:
> #include <iostream>
> #include <gtkmm.h>
> #include <glibmm.h>
>
> class Player : public Gtk::Window
> {
> public:
> Player();
> virtual ~Player();
> };
>
> Player::Player()
> {
> int _pid = 0;
> int _stdin = 0;
> int _stdout = 0;
> int _stderr = 0;
>
> char *vec[5];
> vec[0] = "\"c:/mplayer/mplayer.exe\"";
> vec[1] = "\"-quiet\"";
> vec[2] = "\"-slave\"";
> vec[3] = "\"-idle\"";
> vec[4] = "\"c:/mplayer/truthhappens.ogg\"";
>
> Glib::spawn_async_with_pipes("\"c:/\"", (char**) vec,
> Glib::SpawnFlags(0), sigc::slot<void>(), &_pid, &_stdin, &_stdout,
> &_stderr);
>
> std::cout << "PID: " << _pid << std::endl;
> std::cout << "STDIN: " << _stdin << std::endl;
> std::cout << "STDOUT: " << _stdout << std::endl;
> std::cout << "STDERR: " << _stderr << std::endl;
> show_all_children();
> }
>
> Player::~Player()
> {
> }
>
> int main(int argc, char *argv[])
> {
> Gtk::Main kit(argc, argv);
> Player player;
> Gtk::Main::run(player);
>
> return 0;
> }
>
>
> And the error:
> Player.cpp: In constructor `Player::Player()':
> Player.cpp:26: error: no matching function for call to
> `spawn_async_with_pipes(const char[6], char**, Glib::SpawnFlags,
> sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil,
> sigc::nil, sigc::nil, sigc::nil>, int*, int*, int*, int*)'
> /opt/gtk28win/include/glibmm-2.4/glibmm/spawn.h:147: note: candidates
> are: void Glib::spawn_async_with_pipes(const std::string&, const
> Glib::ArrayHandle<std::string,
> Glib::Container_Helpers::TypeTraits<std::string> >&, const
> Glib::ArrayHandle<std::string,
> Glib::Container_Helpers::TypeTraits<std::string> >&, Glib::SpawnFlags,
> const sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil,
> sigc::nil, sigc::nil, sigc::nil>&, void**, int*, int*, int*)
> /opt/gtk28win/include/glibmm-2.4/glibmm/spawn.h:156: note:
> void Glib::spawn_async_with_pipes(const std::string&, const
> Glib::ArrayHandle<std::string,
> Glib::Container_Helpers::TypeTraits<std::string> >&, Glib::SpawnFlags,
> const sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil,
> sigc::nil, sigc::nil, sigc::nil>&, void**, int*, int*, int*)
>
>
> Thanks in advance for the help...
PIDs are not simply integers on Windows, but pointers in fact (a HANDLE