Ask Your Question
0

Why do I need both static and dynamic libraries to build OpenCV application?

asked 2014-08-06 23:04:53 -0600

konstunn gravatar image

updated 2014-08-06 23:06:01 -0600

I've installed OpenCV from sources with MinGW on 64-bit MS Windows 7. I've chosen to build dynamic libraries.

But when I build OpenCV application I need not only dynamic libraries being available for loading at runtime but I also need to link some static libraries while building binaries, othewise I get error messages from the linker about unresolved external symbols - you know what I mean.

So why do I need both static and dynamic libraries to build OpenCV application?

edit retag flag offensive close merge delete

Comments

Please add the needed information like for example what stuff is giving you problems. I have been using static and dynamic libraries seperately for ages without any problem...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-08-07 06:12:12 -0600 )edit

There is no problem. The question is not about how to fix smth, but why it is so. This question might be about the essentials of using libraries in programming and might not relate to OpenCV itself. It is general, perhaps.

The fact is that this is my first experience using dynamic libraries explicitly. Before this experience I thought that if I have dynamic libraries, then I don't need static ones. But it seems that they are required. Why?

konstunn gravatar imagekonstunn ( 2014-08-07 08:53:09 -0600 )edit
2

What I am saying is that I use dynamic libs without having the static ones. That is absolutely normal ... I do not get your problem :D

StevenPuttemans gravatar imageStevenPuttemans ( 2014-08-07 09:19:17 -0600 )edit

These static libraries are actually import libraries. I've confused them.

konstunn gravatar imagekonstunn ( 2014-08-10 06:56:11 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-08-31 03:38:29 -0600

konstunn gravatar image

These static libraries are actually import libraries for dynamic libraries.

These static libraries are useful to load dynamic libraries implicitly, without invoking LoadLibrary(), GetProcAddress() and so on. Just define exported functions from dll in a header file and invoke them as usual.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-08-06 23:04:53 -0600

Seen: 2,232 times

Last updated: Aug 31 '14