View previous topic :: View next topic |
Author |
Message |
nazarel
Joined: 01 May 2009 Posts: 8 Location: Houston
|
Posted: Wed May 13, 2009 2:48 pm Post subject: Problem with Console Ouput |
|
|
I've installed eclipse c/c++ version for linux, running on Ubuntu 9.04. I've installed the descent plugin. I've followed all the instructions for installing, compiling, and running programs from the Dsource Descent main page. I wrote a simple program, and it compile and runs under descent - but the problem is that the executable created (when I right click and choose Run As > D Application) does not output anything.
Here is the code for the program:
Code: | module MyModule;
version (Tango)
import tango.io.Stdout;
void main()
{
version (Tango)
Stdout("Hello World!");
} |
The code does not run unless I use "version(Tango)". I do have the Tango source code linked in the include path for the project. What am I missing? |
|
Back to top |
|
|
asterite
Joined: 01 Jun 2006 Posts: 235 Location: Buenos Aires, Argentina
|
Posted: Wed May 13, 2009 2:55 pm Post subject: |
|
|
Try this:
Code: | Stdout("Hello World!").flush; |
|
|
Back to top |
|
|
nazarel
Joined: 01 May 2009 Posts: 8 Location: Houston
|
Posted: Wed May 13, 2009 3:11 pm Post subject: Didn't work |
|
|
I added .flush to the source code, but it didn't work. Still no console output. Thanks for the help, though. |
|
Back to top |
|
|
asterite
Joined: 01 Jun 2006 Posts: 235 Location: Buenos Aires, Argentina
|
Posted: Wed May 13, 2009 3:14 pm Post subject: |
|
|
But executing the program from the console does show the output? |
|
Back to top |
|
|
nazarel
Joined: 01 May 2009 Posts: 8 Location: Houston
|
Posted: Wed May 13, 2009 3:40 pm Post subject: Not sure |
|
|
How do I execute the program from the console? I execute the program by selecting the generated executable - main - by right clicking on it and selecting Run As > D Application
When I leave off "version(Tango)" before the statement with Stdout, the compiler generates the errors:
Code: | /home/chris/d/eclipse/workspace/TestD/MyModule.d:8: Error: undefined identifier Stdout
/home/chris/d/eclipse/workspace/TestD/MyModule.d:8: Error: function expected before (), not Stdout of type int
/home/chris/d/eclipse/workspace/TestD/MyModule.d:8: Error: no property 'flush' for type 'int'
/home/chris/d/eclipse/workspace/TestD/MyModule.d:8: Error: long has no effect in expression (1) |
When I leave off the "version(Tango)" before the import statement: import tango.io.Stdout - it generates this error:
Code: | /home/chris/d/eclipse/workspace/TestD/MyModule.d(3): module Stdout cannot read file 'tango/io/Stdout.d' |
Is it a linking issue? |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Thu May 14, 2009 2:23 am Post subject: |
|
|
It seems your compiler is not installed correctly. How did you install it? Always make sure it works outside descent/eclipse before trying with descent. |
|
Back to top |
|
|
nazarel
Joined: 01 May 2009 Posts: 8 Location: Houston
|
Posted: Thu May 14, 2009 5:45 pm Post subject: Works fine now |
|
|
I installed the GDC from the command line (sudo apt-get), and then installed DMD from a download from the Digital Mars website.
I read your post and then installed tango for DMD on Linux and it works now both on the command line and in Eclipse / Descent. I thought I could just link in the tango source I downloaded, but I never installed it - until now. I linked in the DMD compiler through the External Tools in Eclipse and it runs like a dream.
Thanks for the help all! Everything is working great. |
|
Back to top |
|
|
|