# Error when declaring TVector

**URL:** <https://root-forum.cern.ch/t/error-when-declaring-tvector/38798>\
**Category:** Newbie\
**Tags:** root\
**Created:** [April 9, 2020, 11:27pm UTC](https://root-forum.cern.ch/t/error-when-declaring-tvector/38798 "2020-04-09T23:27:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [April 9, 2020, 11:27pm UTC](https://root-forum.cern.ch/t/error-when-declaring-tvector/38798/1 "2020-04-09T23:27:40Z")

</div>

Hello,  
I’m still learning to use ROOT and C++, so I would be grateful for your help.

When I try to declare a TVector (already included in my code), in the very simple way `TVector <double> vec(10, 0);` , it returns the error `error: ‘TVector {aka TVectorT<float>}’ is not a template` .  
I don’t know how to solve this, based on some examples (e.g., [this one](https://www2.cs.duke.edu/csed/tapestry/tvector.html) ) this shouldn’t even be a problem. I’ve been reading lots of posts in this forum but I still couldn’t find the solution to my problem.

Thanks in advance,

Julian.

ROOT Version: 6.14/04  
Platform: Ubuntu

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 10, 2020, 6:22am UTC](https://root-forum.cern.ch/t/error-when-declaring-tvector/38798/2 "2020-04-10T06:22:24Z")

</div>

Either use the [“tvector” from your example](https://www2.cs.duke.edu/csed/tapestry/tvector.html) or use the “[TVectorT](https://root.cern/doc/master/classTVectorT.html)” from the [Linear Algebra in ROOT](https://root.cern.ch/root/htmldoc/guides/users-guide/ROOTUsersGuide.html#linear-algebra-in-root).

---

<div class="post-metadata">

**Author:** ![juliangb](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/juliangb/32/21448_2.png) [@juliangb](https://root-forum.cern.ch/u/juliangb)\
**Post date:** [April 10, 2020, 8:50pm UTC](https://root-forum.cern.ch/t/error-when-declaring-tvector/38798/3 "2020-04-10T20:50:11Z")

</div>

TVectorT worked just fine, thanks!
