How to correctly compile with curl support in D

For some reason, dmd produces a linking command that puts curl and phobos2 in the wrong order (it is strange that it is order sensitive), which can be seen with "dmd -v". Phobos has to be linked before curl. In order to fix this when compiling, you can do:

dmd [filename] -L-lphobos2 -L-lcurl

Inside the .d file, use:


For further discussion, see: