문제

It seems that all my adult life I've been tormented by the VC++ linker complaining or balking because various libraries do not agree on which version of the Runtime library to use. I'm never in the mood to master that dismal subject. So I just try to mess with it until it works. The error messages are never useful. Neither is the Microsoft documentation on the subject - not to me at least.

Sometimes it does not find functions - because the name-mangling is not what was expected? Sometimes it refuses to mix-and-match. Other times it just says, "LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library" Using /NODEFAULTLIB does not work, but the warning seems to be benign. What the heck is "DEFAULTLIB" anyway? How does the linker decide? I've never seen a way to specify to the linker which runtime library to use, only how to tell the compiler which library to create function calls for.

There are "dependency walker" programs that can inspect object files to see what DLL's they depend on. I just ran one on a project I'm trying to build, and it's a real mess. There are system .libs and .dll's that want conflicting runtime versions. For example, COMCTL32.DLL wants MSVCRT.DLL, but I am linking with MSVCRTD.DLL. I am searching to see if there's a COMCTL32D.DLL, even as I type.

So I guess what I'm asking for is a tutorial on how to sort those things out. What do you do, and how do you do it?

Here's what I think I know. Please correct me if any of this is wrong.

  1. The parameters are Debug/Release, Multi-threaded/Single-threaded, and static/DLL. Only six of the eight possible combinations are covered. There is no single-threaded DLL, either Debug or Release.

  2. The settings only affect which runtime library gets linked in (and the calling convention to link with it). You do not, for example, have to use a DLL-based runtime if you are building a DLL, nor do you have to use a Debug version of runtime when building the Debug version of a program, although it seems to help when single-stepping past system calls.

Bonus question: How could anyone or any company create such a mess?

도움이 되었습니까?

해결책

이것은 잘못된 질문에 대한 답변을 찾고 휠을 재발 명하려고하는 것처럼 보입니다.PHP는 치명적인 오류가 발생할 때 PHP가 당신을 확인합니다.

그런 식으로 보려면 코드가 실제로 이미 작동합니다.치명적인 오류가 발생하므로 상위 클래스가 없으므로 코드를 수정해야합니다.부모 수업이 누락되었다고 설립 한 것은 무엇을 할 것입니까?당신은 여전히 그것을 고칠 필요가 있습니다.

내가 말하고 싶은 것은 당신이 치명적인 오류를 제거 할 수 있다면 어떤 곳에서든 당신을 얻지 못한다는 것입니다. 코드는 여전히 결함이 있으며, 어딘가에서 더 멀리 떨어져있을 가능성이 높습니다.확실히 사용자에게 '문제가 있음'을 확실히 할 수는 있지만 그게 PHP가 이미 수행하는 것입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top