Ask Your Question
0

Naming OpenCV target DLLs, when building from source on Windows

asked 2016-02-22 13:23:06 -0500

isaacenrique gravatar image

updated 2016-02-22 13:25:45 -0500

Regards.

I am working with OpenCV on Windows.

Recently, I built OpenCV 2.4 (I used CMake 3.4.2). I only need the core, imgproc and highgui modules, so I built just those modules.

I have noticed that the names of the resulting DLLs are style "libopencv_core2410d.dll"... that is, with the version number included.

Therefore, to link these DLLs in my project file (Qt PRO file) I have lines like this:

-L<my_opencv_install_dir> -lopencv_core2410d -lopencv_imgproc2410d -lopencv_highgui2410d

In contrast, I would rather have a line like this:

-L<my_opencv_install_dir> -lopencv_core -lopencv_imgproc -lopencv_highgui

My doubts are:

I can configure the building process so that the resulting OpenCV DLLs do not include the version number in the name?,

How can I do that?,

Is it advisable to do what I want?

Thank you in advance for any help, suggestions and/or comments

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-02-23 06:48:27 -0500

boaz001 gravatar image

updated 2016-02-23 06:50:19 -0500

Versioning is added here. So you can modify the cmake file there to not add the version to the filename.

The question you should ask yourself is why you want to link to unversioned libraries.

If you have just one application or library that also distributes the opencv DLL's it isn't that important. But when you start to have multiple applications or libraries (that are all linked to an unversioned DLL) you would have to recompile them all when you want to upgrade opencv. With versioned DLL's library A could be linked against opencv_core2410.dll and application B can be linked agains opencv_core300.dll and both DLL's can be distributed to the client without interfering.

Therefore, it is advisable to use versions.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-22 13:23:06 -0500

Seen: 77 times

Last updated: Feb 23 '16