FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with Console Ouput

 
Post new topic   Reply to topic     Forum Index -> Descent
View previous topic :: View next topic  
Author Message
nazarel



Joined: 01 May 2009
Posts: 8
Location: Houston

PostPosted: Wed May 13, 2009 2:48 pm    Post subject: Problem with Console Ouput Reply with quote

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
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Wed May 13, 2009 2:55 pm    Post subject: Reply with quote

Try this:

Code:
Stdout("Hello World!").flush;
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
nazarel



Joined: 01 May 2009
Posts: 8
Location: Houston

PostPosted: Wed May 13, 2009 3:11 pm    Post subject: Didn't work Reply with quote

I added .flush to the source code, but it didn't work. Still no console output. Thanks for the help, though.
Back to top
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Wed May 13, 2009 3:14 pm    Post subject: Reply with quote

But executing the program from the console does show the output?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
nazarel



Joined: 01 May 2009
Posts: 8
Location: Houston

PostPosted: Wed May 13, 2009 3:40 pm    Post subject: Not sure Reply with quote

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
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Thu May 14, 2009 2:23 am    Post subject: Reply with quote

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
View user's profile Send private message
nazarel



Joined: 01 May 2009
Posts: 8
Location: Houston

PostPosted: Thu May 14, 2009 5:45 pm    Post subject: Works fine now Reply with quote

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. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Descent All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group