(Disclaimer: I don't know is this solved on dmd later than 1.030, I'm stuck with it past...)
Problem: PITA when using DMD on windows with custom library paths Example: there is pragma(lib, "mylib.lib"); somewhere in the code. mylib.lib is not on the known path for the compiler (lets say c:\xxx). How to tell dmd where to look for it? 1. dmd ... -Ic:\xxx >> won't work 2. dmd ... -Lsome_flag_to_optlink >> won't work (I haven't found in optlink docs that you can pass argument for >> lib path) 3. set LIB=c:\xxx dmd ... >> won't work (sc.ini in dmd binary folder rewrites LIB env. var with the one >> in it) 4. bud ... -LIBPATH=c:\xxx ... >> wont work (same as 3) 4. edit sc.ini in dmd folder and add c:\xxx >> not smart (not all projects need that lib path, even worse if different >> projects use 2 distinct mylib.lib) 5. create sc.ini in project folder and add c:\xxx to LIB env var >> pain in the royal behind (lot of duplication, as original LIB, DFLAGS and >> LINKCMD are not changed, also, full path to dmd folder must be supplied as >> %...@p% points to project folder now) Is there a way to remedy it? Or just to edit line in original sc.ini in dmd folder from LIB="%...@p%\..\lib";\dm\lib to LIB="%...@p%\..\lib";\dm\lib;%LIB% it seems that adding %LIB% at the end apends existing LIB env var, so paths are preserved.