OSX, Need help with Compiling and linking errors

Israel Rodriguez via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 12 11:54:28 PDT 2014


Ive been reading the OSX notes for the DMD compiler but not 
everything is clear to me as i dont know how exactly the compiler 
looks for things.

i wanted to test it out first using this package from 
code.dlang.org
http://code.dlang.org/packages/colorize
I downloaded the zip, extracted it, and dub was able to spit out 
a static library with the ".a" extension.
What do i do with it now? Where do i place it?

I have imported the library like it says "import colorize : 
colorize, fg;"
After i call dmd in the terminal like "$ dmd main.d", All i get 
are linker errors but no compile errors even if i reference the 
static library in the same drectory as my main.d source file like 
so, "$ dmd main.d libcolorize.a"

Then the package mentions adding colorize as a dependency to my 
projects json file so i used the -X switch to generate it but i 
dont know exactly where the dependencies section goes.

As for the linker errors, they mention mostly:
>===============================================
Undefined symbols for architecture x86_64:
  
"_D4dlib4math6matrix16__T6MatrixTdVi4Z6Matrix11__xopEqualsFKxS4dlib4math6matrix16__T6MatrixTdVi4Z6MatrixKxS4dlib4math6matrix16__T6MatrixTdVi4Z6MatrixZb", 
referenced from:
       
_D52TypeInfo_S4dlib4math6matrix16__T6MatrixTdVi4Z6Matrix6__initZ 
in main.o
ld: symbol(s) not found for architecture x86_64
>===============================================

Does this mean this library is just not compatible with OSX?

Extra Notes:
I have Xcode Installed along with the command line tools so GCC 
is in there too.
OSX 10.9.4
X11 - XQuartz


More information about the Digitalmars-d-learn mailing list