Thread overview
App Build Error
Aug 16, 2015
Benjamin
Aug 17, 2015
Nicholas Wilson
Aug 20, 2015
Benjamin
August 16, 2015
I'm having an issue with building my app - even a simple trivial app (shown below).

I receive the following error message:

	cc -arch i386 -framework CoreFoundation -lobjc -liconv: No such file or directory
	--- errorlevel 255
	
I've removed and reinstalled DMD - same issue.  I'm not really sure whats going on.	

-------------------

BENJAMINs-MacBook-Pro:source benjamin$ ls
app.d
BENJAMINs-MacBook-Pro:source benjamin$ cat app.d
import std.stdio;

void main()
{
	writeln("Hello D!");
}
BENJAMINs-MacBook-Pro:source benjamin$ dmd --version
DMD64 D Compiler v2.068
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
BENJAMINs-MacBook-Pro:source benjamin$
BENJAMINs-MacBook-Pro:source benjamin$
BENJAMINs-MacBook-Pro:source benjamin$ dmd app.d
cc -arch i386 -framework CoreFoundation -lobjc -liconv: No such file or directory
--- errorlevel 255
BENJAMINs-MacBook-Pro:source benjamin$
BENJAMINs-MacBook-Pro:source benjamin$
cc -arch i386 -framework CoreFoundation -lobjc -liconv app.o -o app -m64 -L/usr/local/Cellar/dmd/2.068.0/lib -lphobos2 -lpthread -lm
cc -arch i386 -framework CoreFoundation -lobjc -liconv: No such file or directory
--- errorlevel 255
BENJAMINs-MacBook-Pro:source benjamin$
BENJAMINs-MacBook-Pro:source benjamin$
BENJAMINs-MacBook-Pro:source benjamin$
BENJAMINs-MacBook-Pro:source benjamin$ cc -arch i386 -framework CoreFoundation -lobjc -liconv app.o -o app -m64 -L/usr/local/Cellar/dmd/2.068.0/lib -lphobos2 -lpthread -lm
ld: warning: ignoring file app.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): app.o
ld: warning: ignoring file /usr/local/Cellar/dmd/2.068.0/lib/libphobos2.a, file was built for archive which is not the architecture being linked (i386): /usr/local/Cellar/dmd/2.068.0/lib/libphobos2.a
Undefined symbols for architecture i386:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
BENJAMINs-MacBook-Pro:source benjamin$
August 17, 2015
On Sunday, 16 August 2015 at 17:33:52 UTC, Benjamin wrote:
>
> I'm having an issue with building my app - even a simple trivial app (shown below).
>
> [...]

OS X version?
Have you configured your dmd.conf? iirc it requires linker path changes or something.
Have you looked in /usr/local/lib for libiconv.* ?
Have you any idea why it's targeting i386 and not, say i686 and not passing -m64 by default?
(You're getting the arch mismatch because you passed -m64 and dmd for some reason didn't)
August 20, 2015
On Monday, 17 August 2015 at 01:02:51 UTC, Nicholas Wilson wrote:
> On Sunday, 16 August 2015 at 17:33:52 UTC, Benjamin wrote:
>>
>> I'm having an issue with building my app - even a simple trivial app (shown below).
>>
>> [...]
>
> OS X version?
> Have you configured your dmd.conf? iirc it requires linker path changes or something.
> Have you looked in /usr/local/lib for libiconv.* ?
> Have you any idea why it's targeting i386 and not, say i686 and not passing -m64 by default?
> (You're getting the arch mismatch because you passed -m64 and dmd for some reason didn't)


I'm running OSX 10.10.5.  I've not changed dmd.conf.  I did a fresh install (2.068) after removing the previous version (2.067).  I noticed the arch mismatch, but this is how it was installed.  Nothing special.

Thanks!  Ben.