偶写了一个dll for win2k和win98,可是在关于2k的代码中用到了一个x.dll,是2k特有的,是隐式link的,这个x.dll,98下没有,但是在关于98操作的代码中,没有用到这个x.dll,当在98中,我的app在load我的dll时,会由于找不到x.dll,而不能load我的dll。
我希望98和2k的dll是一个版本,所以不希望使用条件编译。不知那位大侠有妙计??
我希望98和2k的dll是一个版本,所以不希望使用条件编译。不知那位大侠有妙计??
然后.......
You can specify which DLLs to delay load with the /delayload:dllname linker switch. If you do not plan to use your own version of a helper function, you must also link your program with Delayimp.lib.
DELAYLOAD的方法没有用过。试试了。多谢大侠们指点,继续点拨了。
不知用法对不:
在代码中加入
#pragma comment(lib, "delayimp")
#pragma comment(lib, "x")
在setting的link项中加入
/delayload:x.lib编译中有个warning:LINK : warning LNK4199: /DELAYLOAD:pdh.lib ignored; no imports found from x.lib不过照此法2000下的app 和dll工作正常。大侠指点迷津,或有它法,我谢先。
在setting的link项中应加入
/delayload:x.dll,
谢谢afc,也谢谢其他朋友。