Question

I'm using std.net.curl, so I have to link against libcurl.

Adding -L-lcurl works.

However, when I'm adding pragma(lib,"curl"); at the top of the file importing std.net.curl, all sorts of linking errors (missing references) show up.

Why is that? Am I doing anything wrong?


Not such a big issue really, but since I do prefer the pragma way of linking, I'm actually curious why it's working for e.g. sqlite3, but not for Curl.

Était-ce utile?

La solution

The pragma(lib) works best if you compile all the modules together by listing them all on the command line. If you compile them with separate calls to the compiler, the library reference often gets lost (I think the only exception is dmd on Windows).

Are you compiling everything together?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top