简体   繁体   中英

Compile certain header files into DLL (Visual Studio 2010 C++ )

I have a visual studio project where I programmed an interface to a measurement system. The whole projects consists of different classes with headers files and implementations. When I compile the dll I want just the main header to be needed to use the dll.

Example:

MainClass.h
HelperClassA.h
HelperClassB.h
AnotherClassA.h
AnotherClassB.h

MainClass.cpp
HelperClassA.cpp
HelperClassB.cpp
AnotherClassA.cpp
AnotherClassB.cpp

When I compile MainClass.dll I want just to deliver MainClass.h with the dll without the other headers. Is this somehow possible?

Further i use some boost library header files, is it also possible to include them into the dll so that the user using the dll doesn't have to install boost or to have the header files?

When I compile MainClass.dll I want just to deliver MainClass.h with the dll without the other headers. Is this somehow possible?

If your MainClass.h doesn't include any of the headers then this is possible. This could be the case, for instance, if other those headers are only included in your MainClass.cpp file.

Further i use some boost library header files, is it also possible to include them into the dll so that the user using the dll doesn't have to install boost or to have the header files?

For the boost header, the same is true as mentioned above. For any linked boost libraries, I believe it is possible to include static libraries within your DLL. I believe it is not possible to include DLLs in other DLLs.

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