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

Help with using build

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
antdengineer



Joined: 06 Jul 2006
Posts: 10

PostPosted: Mon Jul 10, 2006 10:14 am    Post subject: Help with using build Reply with quote

Im new with the D language and the build tool and Im having some trouble building a little test program using the build tool. I originally posted in the mango section of the forums but im now posting here. Its a simple program that just tests out using mango. When I run build on my program, like this "build test.d", the following is printed to standard output:

Code:

gcc: /home/anthony/workspace/include/mango/mango/text/String.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/text/Text.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/convert/Type.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/convert/Format.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/convert/Integer.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/convert/Atoi.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/convert/Unicode.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/io/model/IWriter.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/io/model/IBuffer.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/io/model/IConduit.o: No such file or directory
gcc: /home/anthony/workspace/include/mango/mango/text/model/UniString.o: No such file or directory


After this occurs, I see all of the above object files are created and in the same directory as test.d as well as test.o . Isnt build supposed to then automatically link these files together? I was able to build an executable file by running:

Code:
dmd test.o Atoi.o Format.o IBuffer.o IConduit.o Integer.o IWriter.o String.o Text.o Type.o Unicode.o UniString.o


but this is a pain. Im I doing this wrong?
Back to top
View user's profile Send private message
PsychoBrat



Joined: 23 Jul 2005
Posts: 22

PostPosted: Mon Jul 10, 2006 8:18 pm    Post subject: Reply with quote

If you run 'dmd' from a terminal, one of the options listed is:
Code:
"-op            do not strip paths from source file"

If you pass this as a parameter to build, I believe that might solve your problem. Let us know? Smile
Back to top
View user's profile Send private message
antdengineer



Joined: 06 Jul 2006
Posts: 10

PostPosted: Tue Jul 11, 2006 4:09 am    Post subject: Reply with quote

Well, that did fix one problem, thak you. The mango object files are now created and put with the mango source files instead of in my programs source directory. Only now I get some linker errors:

Code:

/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(critical.o): In function `_STI_critical_init':critical.c:(.text+0xb0): undefined reference to `pthread_mutexattr_init'
:critical.c:(.text+0xbf): undefined reference to `pthread_mutexattr_settype'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(monitor.o): In function `_STI_monitor_staticctor':monitor.c:(.text+0x18): undefined reference to `pthread_mutexattr_init'
:monitor.c:(.text+0x27): undefined reference to `pthread_mutexattr_settype'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(monitor.o): In function `_STD_monitor_staticdtor':monitor.c:(.text+0x77): undefined reference to `pthread_mutexattr_destroy'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread5startFZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread5startFZv+0xb8): undefined reference to `pthread_create'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread4waitFZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread4waitFZv+0x38): undefined reference to `pthread_join'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread4waitFkZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread4waitFkZv+0xdf): undefined reference to `pthread_cancel'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread5pauseFZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread5pauseFZv+0x13): undefined reference to `pthread_kill'
:std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread5pauseFZv+0x3a): undefined reference to `sem_wait'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread6resumeFZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread6resumeFZv+0x13): undefined reference to `pthread_kill'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread8pauseAllFZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread8pauseAllFZv+0x40): undefined reference to `pthread_kill'
:std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread8pauseAllFZv+0x7b): undefined reference to `sem_wait'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread4initFkZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread4initFkZv+0x20): undefined reference to `pthread_attr_setstacksize'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread11thread_initFZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread11thread_initFZv+0xd7): undefined reference to `sem_init'
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libphobos.a(thread.o): In function `_D3std6thread6Thread12pauseHandlerUiZv':std/thread.d:(.gnu.linkonce.t_D3std6thread6Thread12pauseHandlerUiZv+0x74): undefined reference to `sem_post'
collect2: ld returned 1 exit status


These errors did not occur before when I ran:

Code:
dmd test.o Atoi.o Format.o IBuffer.o IConduit.o Integer.o IWriter.o String.o Text.o Type.o Unicode.o UniString.o


which did yield an executable.
Back to top
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Tue Jul 11, 2006 8:53 am    Post subject: Reply with quote

Add -lpthread (or -L-lpthread) to build's or gcc's command line
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Tue Jul 11, 2006 11:08 pm    Post subject: Reply with quote

Carlos wrote:
Add -lpthread (or -L-lpthread) to build's or gcc's command line

I'm sorry that I've not been able to get back to fixing the Linux edition yet. I'll have another attempt before next week starts.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build 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