I Did It! Calling D Library from Objective C in XCode on OSX

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 15 06:43:47 PST 2015

On Tuesday, 15 December 2015 at 09:04:45 UTC, Jacob Carlborg 
> On 2015-12-15 09:08, Mike McKee wrote:
>> On Tuesday, 15 December 2015 at 07:52:50 UTC, Jacob Carlborg 
>> wrote:
>>> Could you please add "-v" do the command line when compiling.
>> Mine was completely different:
>> $ dmd -v test.d
>> binary    dmd
>> version   v2.069
>> config    /usr/local/bin/dmd.conf
>> parse     test
>> importall main
>> import    object    
>> (/Library/D/dmd/src/druntime/import/object.d)
>> semantic  main
>> entry     main          test.d
>> semantic2 main
>> test.d(7): Error: undefined identifier 'selector'
>> test.d(13): Error: undefined identifier 'selector'
>> test.d(14): Error: undefined identifier 'selector'
>> Also, look what I have in my import/core folder. It doesn't 
>> match yours:
>> atomic.d      checkedint.d  demangle.d    internal/     
>> memory.d
>> simd.d        sync/         thread.d      vararg.d
>> bitop.d       cpuid.d       exception.d   math.d        
>> runtime.d
>> stdc/         sys/          time.d
>> So, then I uninstalled dmd via brew, but found it left a 
>> /Library/D
>> folder behind. Therein lies the problem. So, I did sudo brew 
>> uninstall
>> --force dmd, sudo su, removed the /Library/D folder, and then 
>> sudo brew
>> install dmd. Now it works!

Using sudo with homebrew is strongly recommended against 
(https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#why-does-homebrew-say-sudo-is-bad- ). I have no idea how you got something in /Library/D, but it doubt it was from homebrew. In particular, if you weren't using root then I don't think homebrew would even be able to write there.

> So a broken installer.

Possible, but more likely a leftover from installing dmd some 
other way. Seems to be the case in 90% of "I installed dmd using 
X and it didn't work".

> I recommend using DVM [1]. It can install multiple versions of 
> DMD and they live side by side completely independent.

The important thing is not to mix and match installers unless you 
know how they work.

More information about the Digitalmars-d-learn mailing list