digitalmars.D.bugs - v0.139: importing std.process gives undefined reference on linux
- Georg Wrede (27/27) Nov 08 2005 I get an undefined reference error whenever I import std.process on
I get an undefined reference error whenever I import std.process on Fedora Core 4 and DMD 0.139. import std.process; void main() {} Compiling this gives the following output -- oh, and BTW, there's no /home/clark on my machine. :-) $dmd st2.d gcc st2.o -o st2 -lphobos -lpthread -lm /usr/lib/gcc/i386-redhat-linux/4.0.0/../../../libphobos.a(process.o) (.gnu.linkonce.t_D3std7process7spawnvpFiAaAAaZi+0x3e): In function `_D3std7process7spawnvpFiAaAAaZi': /home/clark/cbx/mars/phobos/std/process.d:58: undefined reference to `spawnvp' collect2: ld returned 1 exit status --- errorlevel 1 Changing "std.process" to "std.c.process" works. For example: import std.c.stdio; import std.c.process; // Skip the ".c" and it breaks. int main(char[][] args) { printf("Trying the 'system(cmd)' thing.\n"); char[] cmd = "/bin/ls -l /root /home >/tmp/ls.out 2>/tmp/ls.err "; int err = system(cmd); printf("system(cmd) returned %d.\n", err); return err; }
Nov 08 2005