www.digitalmars.com         C & C++   DMDScript  

D.gnu - xcode + gdc linking problems

reply Scott Carver <scott artificia.org> writes:
So, I'm working on getting XCode working in a semi-reasonable fashion 
with D (I'm a relative beginner at mucking around with XCode this deep, 
and with D as well, so bear with me...). I got all the appropriate 
language specs, compiler plugins, gdc, etc. (I think), and my sample 
program compiles fine, but fails during the linking phase with this:

	/usr/bin/ld: Undefined symbols:
	_main
	__D10TypeInfo_k6__initZ
	__D11TypeInfo_Aa6__initZ
	__D14TypeInfo_Tuple6__vtblZ
	__D3std5stdio12__ModuleInfoZ
	__D3std5stdio8writeflnFYv
	__Dmodule_ref
	___gdc_personality_v0

I did some checking, and found xcode running this during the linking phase:

/usr/bin/gdc -o /Users/fsc/Documents/DTest/build/Debug/DTest -filelist 
/Users/fsc/Documents/DTest/build/DTest.build/Debug/dtool.build/Objects-normal/pp
/DTest.LinkFileList 
-L/Users/fsc/Documents/DTest/build/Debug 
-F/Users/fsc/Documents/DTest/build/Debug  -arch ppc -Wl,-Y,1455

This fails with the same error when I run it from the terminal. I tried 
different variations on this, and found that everything will link and 
run fine if I /remove/ the '-filelist /Users...etc' option, and just 
specify the .o's by hand, ala:

	/usr/bin/gdc -o (...some stuff...)/*.o (... and the rest ...)

In the end, -filelist doesn't seem to work appropriately. Any 
suggestions? Can anyone point me in the right direction as far as 
modifying the computer plugin / specs / whatever, to get things linking 
right? Am I missing something really obvious? Thanks much!

- Scott Carver
Apr 03 2007
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Scott Carver wrote:

 So, I'm working on getting XCode working in a semi-reasonable fashion 
 with D (I'm a relative beginner at mucking around with XCode this deep, 
 and with D as well, so bear with me...). I got all the appropriate 
 language specs, compiler plugins, gdc, etc. (I think), and my sample 
 program compiles fine, but fails during the linking phase with this:
I haven't gotten Xcode 2.4 to play nice with GDC just yet, either. Posted everything on http://gdcmac.sourceforge.net/xcode.html, but am using custom build rules to pass everything on to GDC...
 In the end, -filelist doesn't seem to work appropriately. Any 
 suggestions? Can anyone point me in the right direction as far as 
 modifying the computer plugin / specs / whatever, to get things linking 
 right? Am I missing something really obvious? Thanks much!
Maybe GDC (the D driver) doesn't support the -filelist option ? If you get it working, I'll be happy to host the compiler plugin. You might also want to investigate Code::Blocks (codeblocks.org) --anders
Apr 04 2007
parent Tristam MacDonald <swiftcoder gmail.com> writes:
XCode 2.4.1 work perfectly, using the compiler-plugin, etc. However, 
you must ling explicitly to both libgcc_eh (otherwise the exception 
handling code fails to link), and libgphobos (if you need any of 
phobos).

I think both of these (and certainly libgcc_eh) should be linked to by 
default, but in the meantime, it is best to just add "-lgcc_eh 
-lgphobos" to the custom linker flags build setting.


On 2007-04-04 03:44:26 -0400, Anders F Björklund <afb algonet.se> said:

 Scott Carver wrote:
 
 So, I'm working on getting XCode working in a semi-reasonable fashion 
 with D (I'm a relative beginner at mucking around with XCode this deep, 
 and with D as well, so bear with me...). I got all the appropriate 
 language specs, compiler plugins, gdc, etc. (I think), and my sample 
 program compiles fine, but fails during the linking phase with this:
I haven't gotten Xcode 2.4 to play nice with GDC just yet, either. Posted everything on http://gdcmac.sourceforge.net/xcode.html, but am using custom build rules to pass everything on to GDC...
 In the end, -filelist doesn't seem to work appropriately. Any 
 suggestions? Can anyone point me in the right direction as far as 
 modifying the computer plugin / specs / whatever, to get things linking 
 right? Am I missing something really obvious? Thanks much!
Maybe GDC (the D driver) doesn't support the -filelist option ? If you get it working, I'll be happy to host the compiler plugin. You might also want to investigate Code::Blocks (codeblocks.org) --anders
Jun 18 2007