简体   繁体   中英

Do C++ executable includes .obj, .lib and .dll?

I have a C++ project that output a C++ .exe . The project is dependant of some .lib and .dll. If I want to use the .exe on another server, can I just transfer the .exe withtout the .lib, .dll, and .obj? Do the .exe was build so it 'includes' these files?

Thank you!

The compile/link process in C++ is complex but generally follows this path.

cpp/hpp-> obj

obj -> lib (.a) for a static library or obj -> dll (.so) for a dynamic library

obj, lib, dll -> exe

The link process will take obj and static libs and form a self contained exe. The linker makes the exe depend on dlls but the exe will not contain the dynamic library.

Answering your questions, the exe and dll(s) will be needed at runtime. The obj and static lib files will definitely not be needed at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM