Qhov txawv ntawm DLL thiab LIB

Qhov txawv ntawm DLL thiab LIB
Qhov txawv ntawm DLL thiab LIB

Video: Qhov txawv ntawm DLL thiab LIB

Video: Qhov txawv ntawm DLL thiab LIB
Video: KEV PAB UA KOM NTEV 2024, Kaum ib hlis
Anonim

DLL vs LIB

Ib lub tsev qiv ntawv yog ib phau ntawm cov peev txheej uas tuaj yeem siv los tsim cov ntawv thov. Lub tsev qiv ntawv feem ntau yog ua los ntawm cov txheej txheem subroutines, kev ua haujlwm, cov chav kawm, qhov tseem ceeb thiab hom. Thaum lub sij hawm sib txuas cov txheej txheem (feem ntau yog ua los ntawm ib tug linker), cov tsev qiv ntawv thiab executables ua siv rau ib leeg. Cov tsev qiv ntawv cov ntaub ntawv tau muab faib rau hauv cov tsev qiv ntawv zoo li qub thiab dynamic nyob ntawm lub sijhawm uas cov subroutines raug thauj mus rau lub hom phiaj daim ntawv thov. Raws li, LIB cov ntaub ntawv yog statically txuas cov tsev qiv ntawv thiab DLL cov ntaub ntawv yog cov tsev qiv ntawv txuas nrog dynamically.

DLL yog dab tsi?

Dynamic Link Library (feem ntau hu ua DLL) yog kev siv lub tsev qiv ntawv sib koom tsim los ntawm Microsoft. Nws siv.dll,.ocx lossis.drv extensions thiab lawv tau siv hauv Microsoft Windows thiab OS/2 operating systems..dll yog siv los ntawm cov ntaub ntawv DLL li niaj zaus. Thiab.ocx txuas ntxiv yog siv los ntawm cov tsev qiv ntawv uas muaj ActiveX tswj thiab.drv txuas ntxiv yog siv los ntawm cov ntaub ntawv keeb kwm tsav tsheb. Cov ntaub ntawv DLL yog tib yam li Windows EXE cov ntaub ntawv (Portable Executable cov ntaub ntawv ntawm 32-ntsis / 64-ntsis Windows, thiab Kev Ua Haujlwm Tshiab ntawm 16-ntsis Windows). Yog li ntawd, ib qho kev sib txuas ntawm cov lej, cov ntaub ntawv thiab cov peev txheej tuaj yeem muaj nyob hauv DLL cov ntaub ntawv (ib yam li hauv EXE cov ntaub ntawv). Raws li qhov tseeb, cov ntaub ntawv cov ntaub ntawv nrog DLL cov ntaub ntawv hom yog hu ua cov peev txheej DLLs. Icon tsev qiv ntawv (nrog.icl txuas ntxiv) thiab cov ntaub ntawv font (nrog.fon thiab.fot extensions) yog cov piv txwv ntawm cov peev txheej DLLs.

Cov khoom hu ua ntu ua rau DLL thiab txhua ntu muaj nws tus yam ntxwv xws li nyeem nkaus xwb / sau tau thiab ua tau / tsis ua tiav. Code seem yog executable, thaum cov ntaub ntawv seem yog tsis executable. Cov tshooj cai tau muab faib thiab cov ntaub ntawv seem yog ntiag tug. Qhov ntawd txhais tau tias tag nrho cov txheej txheem siv DLL yuav siv tib daim ntawv theej, thaum txhua tus txheej txheem yuav muaj nws tus kheej daim ntawv theej ntawm cov ntaub ntawv. Lub tsev qiv ntawv tseem ceeb rau Windows yog kernel32.dll, uas muaj cov haujlwm hauv paus (cov ntaub ntawv thiab kev nco txog kev ua haujlwm) ntawm Windows. COM (Component Object Model) yog qhov txuas ntxiv ntawm DLL rau OOP (Object Oriented Programming). Pa DLLs yooj yim siv dua COM cov ntaub ntawv.

LIB is?

LIB cov ntaub ntawv yog cov tsev qiv ntawv zoo li qub (tseem hu ua statically txuas cov tsev qiv ntawv). LIB cov ntaub ntawv muaj cov sau ua ke ntawm subroutines, kev ua haujlwm sab nraud thiab hloov pauv. LIB cov ntaub ntawv raug daws nyob rau hauv lub sij hawm compile (as opposed to run-time). Cov cai tau theej rau hauv lub hom phiaj daim ntawv thov. Ib tug compiler, linker los yog ib tug binder yuav ua qhov kev daws teeb meem no thiab tsim cov khoom siv thiab cov ntaub ntawv executable. Cov txheej txheem no hu ua static build process.

DLL thiab LIB yog dab tsi?

LIB cov tsev qiv ntawv tuaj yeem hu tau thaum lub sijhawm sau, tab sis DLL cov tsev qiv ntawv tsuas tuaj yeem hu thaum lub sijhawm khiav haujlwm. LIB cov ntaub ntawv yog qhov loj dua DLL cov ntaub ntawv. Ib qho teeb meem tshwm sim heev nrog DLL cov ntaub ntawv yog qhov teeb meem versioning. Qhov no tshwm sim thaum lub code ntawm DLL hloov thiab daim ntawv thov siv ib tug tsis ncaj ncees lawm version ntawm ib tug DLL. Qhov no tsis yog teeb meem cuam tshuam nrog LIB cov ntaub ntawv. Nyob rau hauv cov nqe lus ntawm reusability, thaum sau ntawv tshiab versions ntawm systems los yog tag nrho cov ntawv thov tshiab, DLLs yeej ib txwm zoo dua li LIBs.

Pom zoo: