digitalmars.D - Conflicting variable- stdin
- DemmeGod (29/29) Jun 08 2004 I get the following error:
- Ivan Senji (7/36) Jun 08 2004 I had lots of those errors:
- DemmeGod (6/11) Jun 08 2004 Thanks. That works. I tried doing:
- DemmeGod (3/36) Jun 08 2004 Forgot to mention: if I make the two imports in AssertError private, it
I get the following error: dmd -I. -Ibuild -c -ofbuild/daemon.o build/daemon.d /usr/share/dmd/src/phobos/std/stream.d(2050): variable stdin conflicts with stdio.stdin at /usr/share/dmd/src/phobos/std/c/stdio.d(131) When trying to compile the following code: <snip> private import com.neuralnexus.nnstore; private import std.stream; private import std.asserterror; void main() { while (1) { char[] inp = stdin.readLine(); try { outTest(inp); } catch (AssertError e) { printf(e.toString() ~ "\n"); } } } </snip> This feels like a stupid error, but I can't find an obvious solution. When the stdin.readLine() is commented out, it compiles no problem. Any suggestions? TIA John
Jun 08 2004
I had lots of those errors: try something like alias std.stream.stdin stdin; after the imports. "DemmeGod" <me demmegod.com> wrote in message news:pan.2004.06.08.21.01.06.108753 demmegod.com...I get the following error: dmd -I. -Ibuild -c -ofbuild/daemon.o build/daemon.d /usr/share/dmd/src/phobos/std/stream.d(2050): variable stdin conflictswith stdio.stdin at /usr/share/dmd/src/phobos/std/c/stdio.d(131)When trying to compile the following code: <snip> private import com.neuralnexus.nnstore; private import std.stream; private import std.asserterror; void main() { while (1) { char[] inp = stdin.readLine(); try { outTest(inp); } catch (AssertError e) { printf(e.toString() ~ "\n"); } } } </snip> This feels like a stupid error, but I can't find an obvious solution. When the stdin.readLine() is commented out, it compiles no problem. Any suggestions? TIA John
Jun 08 2004
Thanks. That works. I tried doing: char[] inp = std.stream.stdin.readLine(); but it spits out an undefined error. What's different about alias that it works? John On Tue, 08 Jun 2004 23:02:43 +0200, Ivan Senji wrote:I had lots of those errors: try something like alias std.stream.stdin stdin; after the imports.
Jun 08 2004
Forgot to mention: if I make the two imports in AssertError private, it works, but I'm not sure how this will effect everything/anything else. On Tue, 08 Jun 2004 17:01:09 -0400, DemmeGod wrote:I get the following error: dmd -I. -Ibuild -c -ofbuild/daemon.o build/daemon.d /usr/share/dmd/src/phobos/std/stream.d(2050): variable stdin conflicts with stdio.stdin at /usr/share/dmd/src/phobos/std/c/stdio.d(131) When trying to compile the following code: <snip> private import com.neuralnexus.nnstore; private import std.stream; private import std.asserterror; void main() { while (1) { char[] inp = stdin.readLine(); try { outTest(inp); } catch (AssertError e) { printf(e.toString() ~ "\n"); } } } </snip> This feels like a stupid error, but I can't find an obvious solution. When the stdin.readLine() is commented out, it compiles no problem. Any suggestions? TIA John
Jun 08 2004