I
I
Igor Oleinik2014-01-25 23:51:26
C++ / C#
Igor Oleinik, 2014-01-25 23:51:26

How to include libraries in C++?

I decided to use OpenCV for the project, started connecting to Visual Studio.
But this is not the point, I'm interested (abstractly from OpenCV) : do libraries always get connected so gemorno in C ++? Somehow it causes a lot of inconvenience that you have to write paths to different files (.lib and .dll) (moreover, different for Debug and Release versions) in the project settings (also in different points), add paths to system variables, headers in the project, etc. Is it always like this on the pluses or is it just a library like that? It's just that my knowledge of pluses is limited only to a university course ... Can't you just take and throw the dll into a folder, add it to the references (as in C #)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lookid, 2014-01-26
@IgorOleynick

Yes. C++ was made as a research project. Well, that's how we decided. We considered that splitting into h + lib + dll is more efficient. Python was made by one person on the knee, and accordingly it turned out to be easier.
www.emgu.com/wiki/index.php/Main_Page here is the .Net wrapper to the OpenCV

D
DancingOnWater, 2014-01-27
@DancingOnWater

Generally speaking, in any compiled language, the connection to a shared library goes exactly like this. It's all about how the IDE automates this.
Due to the dismissive attitude of MS to C ++, there is no normal support for it in the studio. In my experience, QtCreator is the most tailored for the pluses of an IDE and convenient.

A
AxisPod, 2014-01-26
@AxisPod

Nobody forbids you to use Release libraries in Debug mode, you can use the same library. Unless you can normally trace this library.
There are no special connection problems, the problem is that the runtime library must be of the same version, otherwise you can catch very strange bugs.
The difference with C# is that everything is stored in one file, while in C++ in different ones.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question