Linker problems with arm-wince, need help/info

David Friedman dvdfrdmn at users.ess-eff.net
Fri Jun 9 03:44:05 PDT 2006


Chad J wrote:
> Whenever I try to compile stuff with the arm-wince-pe-gdc compiler I'm 
> working on, it gives me this kind of error message:
> 
> /tmp/ccCUG0Nj.o(.text+0x44):main.d: undefined reference to 
> `_D3std4file5writeFAaAvZv'
> /tmp/ccCUG0Nj.o(.text+0x8c):main.d: undefined reference to `_Dmodule_ref'
> /tmp/ccCUG0Nj.o(.data+0x40):main.d: undefined reference to 
> `_ModuleInfo_3std4file'
> /usr/local/arm-wince-pe/EntryPoint/Console/crt0.o(.text+0x2c): undefined 
> reference to `main'
> collect2: ld returned 1 exit status
> 
> I'm pretty sure it is linking in gphobos.  I've even tried explicitly 
> linking to gphobos, and I get exactly the same problems.  Lemme guess, 
> the same startfile (crt0.o) that worked for C plus plus, won't work for 
> D?  If that's the case, I'd like to know what D needs in a startfile and 
> where I can go to learn how to write startfiles.
> 
> Otherwise, I'm fairly clueless.  I looked for those symbols in gphobos 
> with a hex editor and found them.  I'm not sure what that means though 
> as I don't understand the guts of the linking process.  My startfile 
> hunch aside, anyone know what these errors might be about?

Two things to check:

What is the order of libraries / objects on the linker command line? 
(Use gdc -v ...)

Are the symbols actually defined in gphobos?  Use nm libgphobos.a to see 
if the names are actually definitions.

David



More information about the D.gnu mailing list