How to create a visual solution for Studio 2010 in a standalone dll?

I have a visual studio 2010 project, it uses static and dynamic libraries ( .lib and .dll ), the project is compiled and successfully created as .exe both release and debug modes, c and C ++ code.

What is the correct way to compile and package the entire solution into one standalone .dll file.

I want to have one dll file, I can upload it in other projects c, C ++, C #.

in my case, I want to load it into teraterm and into another simple self-developed C # application.

+6
source share
2 answers

Visual Studio has a C ++ link called "Link Library Dependencies": http://msdn.microsoft.com/en-us/library/024awkd1(v=vs.90).aspx

This will link the object files with all the projects in the solution directly to the project exit (via dependency tracking). Be careful if you use this, but if you use it in the EXE and DLLs that you associate with exporting characters, the EXE also exports them.

Update:

Here, in more detail: what happens is that instead of linking the DLLs (it is assumed that you have DLLs that you want to link as dependencies of your project in the solution) to create separate binary files, the linker takes the output from each individual project dependencies and directly links them to the final executable / DLL, thereby creating a monolithic DLL.

A side effect is that (depending on the code) the overall size of the output decreases slightly, the monolithic DLL (or EXE) can be large in general, but smaller in size than the individual output files combined due to link optimization. Any characters exported by related objects will be exported by the final DLL, since they are marked as such at the compilation stage.

+1
source

There may be a trick, but being in VS2010, you just need to click on the startup project, select "properties" → "configuration properties" → "general" → "configuration type" → set it to "dynamic library (dll)"

0
source

Source: https://habr.com/ru/post/952072/


All Articles