Failure to register .dll with regsvr32 - only in Release build

萝らか妹 提交于 2019-12-24 14:19:07

问题


I'm having a weird problem when trying to register the .dll i created using regsvr32.

During development everything went fine, the debug version registers and works fine. Now i wanted to create a Release version, but that Version does not register anymore.

regsvr32 comes up with the following error:

The module "mpegsplitter.dll" failed to load.

Make sure the binary is stored at the specified path or
debug it to check for problems with the binary or
dependent .DLL files.

The specified procedure could not be found.

Some research brought me to the dependency walker, which does tell me this

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.

It also does show a dependency on "crtdll.dll" that the debug version does not have (The function view shows soem functions that normally should be in ole32.dll), which is colored red'ish.

So far so good, i guess its somehow related to what the dependency walker shows there.

But where do i go from here? How do i fix it? Any help would be greatly appreciated, that has been keeping me busy for several hours already.

Thanks!


回答1:


I have the same problem. When I compared the different between "Command Line" (in Project Properties -> Linker) of Release and Debug mode, I found out that the "Optimization" options (in Project Properties -> Linker) of Release mode was turned on while ion Debug not. Turning of Optimization for linker in Release mode solved the problem




回答2:


Is it possible that the debug version is compiled with _ATL_MIN_CRT but the release version isn't? You can set this with the Minimize CRT Use in ATL project property as well.




回答3:


I fixed it. It was actually being caused by the order of some mingw libraries i included to link against ffmpeg. Oh well, how weird.



来源:https://stackoverflow.com/questions/2892463/failure-to-register-dll-with-regsvr32-only-in-release-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!