简体   繁体   English

从第三方代码检查库版本

[英]Check library version from third party code

I have code that was implements the OpenCV library, however, I do not know what version of the library it was written with. 我有实现OpenCV库的代码,但是,我不知道它是用哪个版本的库编写的。 Is there anyway to find out from the code what version of the library that it was intended to be used with? 无论如何,是否可以从代码中找到打算使用的库版本?

The only references to the library in the code is: 代码中对库的唯一引用是:

#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/opencv.hpp"

There is no way to know for sure given that limited information, unless perhaps if you can run ldd and strings on a built executable you have. 有没有办法知道肯定考虑到有限的信息,除非也许 ,如果你可以运行lddstrings上生成的可执行文件,你有。 But I suggest that OpenCV 2.4.11 is very likely to work with what you have. 但我建议OpenCV 2.4.11很可能可以与您所拥有的一起使用。

OpenCV was designed to be backwards compatible within every major version, that is the latest 2.XY revision should support any code written in version 2.XZ Since version 3.0.0 was released, any 2.X code may need to be reworked. OpenCV被设计为在每个主要版本中都向后兼容,即最新的2.XY修订版应支持版本2.XZ中编写的任何代码。自版本3.0.0发布以来,任何2.X代码都可能需要重新编写。 This guy explains how to check version using code. 这个家伙解释了如何使用代码检查版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM