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.

有帮助吗?

解决方案

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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top