Linker (LD) Options

This is a continuation of Using MailCore in a Cocoa App

In Fire I can set options in settings

“uchardet ctemplate etpan xml2 sasl2 iconv tidy lcrypto ssl”

When I attempt to build I get

CrossBox error Link: ld: file not found: uchardet

How does the compiler find the file ?

Also I’m assuming I don’t need fx files for all these ?

Building the mailcore project in xcode and going to the debug directory, I can see its added libetpan, libuchardset and libctemplate in addition to libMailCore.

Also how does fxgen fit in here ? I can also set “Libraries to link” there

Thanks,
John

If I set Libraries to link in fxgen it builds.

-l (lowercase) asks the linker to link a library of a given name. e.g. -lxml2
-L (capital) provides the linker with a path to look for libraries, e.g. -L/usr/lib

Usually these are provided in pairs, except for system libraries which are found automatically. This the is general LD command line, not specific to Elements.

anything you put in “libraries to link” in fxgden will get encoded into the .fx so that the compile knows to pass -l for the library. for example, if you add xml2 to “libraries to link”, the compiler will automatically pass lxml2 to LD during linking (and because libxml2 is a standard library, the linker will find it by default, w/o a path seeing to be passed via -L.

Thanks, I added all the library references in fxgen. Mailcore2 has lots of header files, I found that I can specify MailCore*.h in Headers and that picks up everything.

So I’m how able to send email in my cocoa app :slight_smile:

1 Like