Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
55d1f0b7
Commit
55d1f0b7
authored
May 25, 2015
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transition guide: removed one of the version check methods
parent
44d1738d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
transition_guide.markdown
...s/introduction/transition_guide/transition_guide.markdown
+3
-15
No files found.
doc/tutorials/introduction/transition_guide/transition_guide.markdown
View file @
55d1f0b7
...
...
@@ -264,28 +264,16 @@ In some cases it is possible to support both versions of OpenCV.
### Source code
To check library major version one of the following methods can be used:
-
if __CV_VERSION_EPOCH__ is defined - you are using 2.4 branch, otherwise - 3.x
-
__CV_MAJOR_VERSION__ is defined as
`2`
or
`3`
for corresponding version
One of
`opencv2/core/version.hpp`
or
`opencv2/core/core.hpp`
files should be included to use these definitions.
Examples:
@code{.cpp}
#ifdef CV_VERSION_EPOCH
// do opencv 2 code
#else
// do opencv 3 code
#endif
@endcode
or
To check library major version in your application source code, the following method should be used:
@code{.cpp}
#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION == 2
// do opencv 2 code
#elif CV_MAJOR_VERSION == 3
// do opencv 3 code
#endif
@endcode
@note Do not use __CV_VERSION_MAJOR__, it has different meaning for 2.4 and 3.x branches!
### Build system
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment