문제

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