R
R
rosty2018-12-29 17:07:54
C++ / C#
rosty, 2018-12-29 17:07:54

How to include a C++ library without a DLL file?

I want to use a non standard library in Visual Studio. When I connect the library, I definitely need to put the DLL file of the library in the folder with the output EXE file. Is there any way to do without it if I only want to get an EXE file as output?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kalombyr, 2018-12-29
@Kalombyr

Of course.
Static linking is called - everything is built into the exe file.
The first thing that came up in the search engine:
https://social.msdn.microsoft.com/Forums/vstudio/e...

R
res2001, 2018-12-29
@res2001

You can compile the program without the presence of a dll, the main thing is that there is a lib file from this dll and header files for static linking.
In the case of dynamic linking (using LoadLibrary() and GetProcAddress()), the lib file is not needed either.
What kind of binding is used by you - you know better.
DLL will be needed at the stage of program execution. In the case of static linking without a DLL, the program will not load with a corresponding error from the OS. In the case of dynamic linking, LoadLibrary() will return an error if the dll is not available.

L
Legebocker, 2018-12-30
@EnDeRJaY

Using dynamic libraries is good, it compiles much less, and it’s a sin to refuse them, but if you want the source for half a gig, then google about static linking

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question