문제

파일 시스템 및 레지스트리 전체에 걸쳐 Windows에 설치하는 특정 그룹의 공통 불만이며 일부 응용 프로그램은 파일을 압축 해제하면 단순히 삭제할 수있는 옵션을 제공합니다.그러나 Visual C ++ Redist, Sight-by-side (Sx) 등의 모든 추악함을 어떻게 피할 수 있습니까?

나는 조금 유틸리티를 가지고 있으며, 정말로 실행되는 단일 .exe를 배포하는 것을 선호합니다. 모든 설치 프로그램이 없거나 심지어 멈추지 않거나 압축 해제합니다.이 실현 가능합니까?

편집 : 제안 된 바와 같이, 나는 런타임 (/ md 대신 / md 대신 / mt 대신 / mt 대신 / mt)에 대한 정적 종속성으로 빌드를 시도했다.나는 다음을 얻었습니다 (중간 부분이 잘립니다) :

1>Linking...
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __mbschr already defined in LIBCMT.lib(mbschr.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _abort already defined in LIBCMT.lib(abort.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj)
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _setlocale already defined in LIBCMT.lib(setlocal.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
.

도움이 되었습니까?

해결책

You can distribute a single EXE if you statically link to the VC runtime - on the project's Property Page -> Configuration Properties -> C/C++ -> Code Generation and set "Runtime Library" to a "non-dll" option.

Depending on your target audience, distributing as a .exe may be problematic as .exe files are sometimes blocked from downloading in corporate environments, so providing a .zip file as well is advisable.

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