GNOME Bugzilla – Bug 580310
cannot pass NULL env to spawn_async()
Last modified: 2009-07-06 14:14:32 UTC
Please describe the problem: glib allows you to spawn a process and inherit the parent's environment by passing NULL for the envp parameter. envp : child's environment, or NULL to inherit parent's Doing this in glibmm results in an error: /usr/include/glibmm-2.4/glibmm/arrayhandle.h:83: error: request for member 'begin' in 'cont', which is of non-class type 'const int' Steps to reproduce: 1. Pass NULL for envp param 2. 3. Actual results: Compile error. Expected results: Error doesn't occur. Parent's environment should be inherited. Does this happen every time? Yes. Other information: I'm not sure how to work around this.
The documentation is auto-generated from the C API documentation and thus sometimes confusing in the manner you experienced. But you can simply use the other spawn_async() overload which doesn't take the env vector argument: <http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__Spawn.html#g0c4e1708989b50fb34266504cc038ee6>