OSX, Need help with Compiling and linking errors

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 12 18:53:14 PDT 2014


On 7/13/2014 3:54 AM, Israel Rodriguez wrote:

>
> 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?


The linker errors do not refer to libcolorize. Notice this: 
"_D4dlib4math6matrix". That is a dlib.math.matrix module. Is that a 
source module in your project or something from another library? If the 
former, you need to be compiling it along with your main.d. If the 
latter, you need to be linking with that library. However, I recommend 
you avoid using dmd on the command line for now and just use dub to 
manage your project (see below).

 >
 > 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.

This has nothing to do with the json generated by DMD. It's referring to 
a dub.json which is a project configuration file for dub. If you create 
a dub.json, then you can run "dub" or "dub build" in your project 
directory and it will automatically compile all of your source modules 
and make sure that all of your dependencies (such as libcolorize) are 
downloaded, compiled and link. It's a complete build and package 
management system. You don't need to download your dependencies manually 
or compile from the command line if you are using dub. You can read more 
about the dub.json format at [1].

[1] http://code.dlang.org/package-format



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



More information about the Digitalmars-d-learn mailing list