nawaman
Joined: 31 Mar 2007 Posts: 1
|
Posted: Sat Mar 31, 2007 1:41 pm Post subject: Problem getting start |
|
|
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. |
|