# Can't use part of conarlib files

**URL:** https://forum.opencv.org/t/cant-use-part-of-conarlib-files/17254
**Category:** C++
**Tags:** tracking, build, contrib
**Created:** [April 11, 2024, 7:01am UTC](https://forum.opencv.org/t/cant-use-part-of-conarlib-files/17254 "2024-04-11T07:01:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lalitesler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/lalitesler/32/10177_2.png) [@lalitesler](https://forum.opencv.org/u/lalitesler)
#### Post date: [April 11, 2024, 7:01am UTC](https://forum.opencv.org/t/cant-use-part-of-conarlib-files/17254/1 "2024-04-11T07:01:00Z")

</div>

Hi, I have a problem with the trackers, I installed the contrib folder, I can access the tracking\_legacy.hpp file but not use its classes, but tracking.hpp working, what could be the problem?  
I use opencv 4.9.0

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [April 11, 2024, 7:52am UTC](https://forum.opencv.org/t/cant-use-part-of-conarlib-files/17254/2 "2024-04-11T07:52:48Z")

</div>

a specific error message would help.

please browse the official documentation to learn which headers you need and which namespaces contain which classes and functions.

using modules from contrib requires building opencv _with_ those modules. the contrib/modules directory needs to be announced to cmake as a variable. details can be found in the documentation.

---

<div class="post-metadata">

### Author: ![lalitesler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/lalitesler/32/10177_2.png) [@lalitesler](https://forum.opencv.org/u/lalitesler)
#### Post date: [April 11, 2024, 8:19am UTC](https://forum.opencv.org/t/cant-use-part-of-conarlib-files/17254/3 "2024-04-11T08:19:09Z")

</div>

1\>------ Build started: Project: Yolo5, Configuration: Debug x64 ------  
1\>Yolo5.cpp  
1\>C:\Users\The user\opencv\_contrib\modules\tracking\include\opencv2\tracking.hpp(17,27): error C2871: ‘legacy’: a namespace with this name does not exist  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(42,22): error C2653: ‘TrackerBoosting’: is not a class or namespace name  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(42,39): error C3861: ‘create’: identifier not found  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(48,23): error C2653: ‘TrackerTLD’: is not a class or namespace name  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(48,35): error C3861: ‘create’: identifier not found  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(50,23): error C2653: ‘TrackerMedianFlow’: is not a class or namespace name  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(50,42): error C3861: ‘create’: identifier not found  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(54,23): error C2653: ‘TrackerMOSSE’: is not a class or namespace name  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(54,37): error C3861: ‘create’: identifier not found  
1\>C:\Users\The user\Documents\practicum\Yolo5\Yolo5.cpp(93,19): warning C4244: ‘initializing’: conversion from ‘double’ to ‘float’, possible loss of data  
1\>Done building project “Yolo5.vcxproj” – FAILED.  
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

#include \<opencv2/video/tracking.hpp\>  
#include \<opencv2/core/ocl.hpp\>  
#include \<opencv2/video/tracking.hpp\>  
#include \<modules/tracking/include/opencv2/tracking.hpp\>  
#include\<modules/tracking/include/opencv2/tracking/tracking\_legacy.hpp\>

When I open the file tracking\_legacy.hpp, it contains all the classes it can’t find, why doesn’t it work for me?

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [April 11, 2024, 9:33am UTC](https://forum.opencv.org/t/cant-use-part-of-conarlib-files/17254/4 "2024-04-11T09:33:47Z")

</div>

you need to make sure that your copies (clones) of both the main and contrib repository are checked out to the same branch or tag (version tag).

> [@lalitesler](#):
>
> #include \<modules/tracking/include/opencv2/tracking.hpp\>  
> #include\<modules/tracking/include/opencv2/tracking/tracking\_legacy.hpp\>

those do _not_ look correct at all.

use the documentation.

[https://docs.opencv.org/4.x/dc/d6b/group\_\_tracking\_\_legacy.html](https://docs.opencv.org/4.x/dc/d6b/group __tracking__ legacy.html)
