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

Problem getting start

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
nawaman



Joined: 31 Mar 2007
Posts: 1

PostPosted: Sat Mar 31, 2007 1:41 pm    Post subject: Problem getting start Reply with quote

Hi All,
I am a Java Programmer. Recently I feels that I want to learn a programming language that is compiled to native rather than virtual but I don't many pitfall of C/C++. So I am wanted to try D.
I installed D as suggested on http://www.prowiki.org/wiki4d/wiki.cgi?HowToUbuntu for both alternative as well as the IDE. There is no error during the install as I can see.
Then, I create a very simple and innocent program called hello.d

Code:

import std.stdio;

void main(char[][] args) {

    writefln("Hello World");

}


This is what I get when I compiled it
Code:

~$ gdc hello.d
/usr/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libgphobos.a(threadsem.o): In function `_D3gcc9threadsem9Semaphore6createMFZb':
(.text+0x59): undefined reference to `sem_init'
/usr/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libgphobos.a(threadsem.o): In function `_D3gcc9threadsem9Semaphore6signalMFZv':
(.text+0x25): undefined reference to `sem_post'
/usr/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libgphobos.a(threadsem.o): In function `_D3gcc9threadsem9Semaphore4waitMFZv':
(.text+0x35): undefined reference to `sem_wait'
collect2: ld returned 1 exit status


and

Code:

~$ dmd hello.d
gcc hello.o -o hello -m32 -lphobos -lpthread -lm
/usr/local/lib/libphobos.a(thread.o): In function `_D3std6thread6Thread5pauseMFZv':
std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread5pauseMFZv+0x25): undefined reference to `sem_wait'
/usr/local/lib/libphobos.a(thread.o): In function `_D3std6thread6Thread8pauseAllFZv':
std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread8pauseAllFZv+0x7b): undefined reference to `sem_wait'
/usr/local/lib/libphobos.a(thread.o): In function `_D3std6thread6Thread11thread_initFZv':
std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread11thread_initFZv+0xca): undefined reference to `sem_init'
/usr/local/lib/libphobos.a(thread.o): In function `_D3std6thread6Thread12pauseHandlerUiZv':
std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread12pauseHandlerUiZv+0x71): undefined reference to `sem_post'
collect2: ld returned 1 exit status
--- errorlevel 1


What did I do wrong? and What can I do next? Please help. Any suggestion is appropriated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General 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