# Can't open file TLorentzVector.h

**URL:** <https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043>\
**Category:** Newbie\
**Created:** [February 19, 2020, 9:07am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043 "2020-02-19T09:07:50Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![tkar](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/d6d6ee/32.png) [@tkar](https://root-forum.cern.ch/u/tkar)\
**Post date:** [March 25, 2020, 5:35pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/21 "2020-03-25T17:35:42Z")

</div>

Hi Rooters,  
I have a similar problem.  
TLorentzVector works fine when I compile from root CINT, but it complains when I try to compile using g++.  
I get the following Error:  
SignalEventList\_b4Sim.cc:452:2: error: ‘TLorentzVector’ was not declared in this scope  
TLorentzVector bJ1, bJ2, bJ3, bJ4;  
After this, I included \<TLorentzVector.h\> and compiled again. This resulted in a big list of errors attached in log.txt[log.txt](https://root-forum.cern.ch/uploads/short-url/8nstOzTSBAMs5lzNqnI1DXUHxUL.txt) (30.1 KB)  
I am using it along with fastJet. The source code and the compilation script is attached.  
Also, ls -al `root-config --incdir`/TLorentzVector.h gives:  
-rw-r–r-- 1 tamasi tamasi 19356 May 23 2019 /home/tamasi/build/include/TLorentzVector.h  
and  
locate TLorentzVector gives:[SignalEventList\_b4Sim.cc](https://root-forum.cern.ch/uploads/short-url/iX6FrOSzDmlynUsBctYgRNNCtx3.cc) (16.4 KB) [compileEventList\_b4Sim.txt](https://root-forum.cern.ch/uploads/short-url/efnjB2TJJ5fxcuJAebkReyLyZEM.txt) (145 Bytes)  
/home/tamasi/build/include/TLorentzVector.h  
/home/tamasi/build/math/physics/CMakeFiles/Physics.dir/src/TLorentzVector.cxx.o  
/home/tamasi/root/math/physics/inc/TLorentzVector.h  
/home/tamasi/root/math/physics/src/TLorentzVector.cxx

Can someone help me fix this?

Best Regards,  
Tamasi

---

<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:** [March 25, 2020, 5:55pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/22 "2020-03-25T17:55:54Z")

</div>

Try to remove (of course, you will then need to explicitly write “fastjet::ClusterSequence” and so on): “`using namespace fastjet;`”

---

<div class="post-metadata">

**Author:** ![tkar](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/d6d6ee/32.png) [@tkar](https://root-forum.cern.ch/u/tkar)\
**Post date:** [March 25, 2020, 6:09pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/23 "2020-03-25T18:09:18Z")

</div>

Hi,  
Thanks a lot. I changed the order of the includes and it compiled. Instead of having the fastJet includes first, I added the root includes first followed by fastJet includes, and it worked. Why is the order of includes so important?  
Cheers,  
Tamasi

---

<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:** [March 25, 2020, 6:52pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/24 "2020-03-25T18:52:16Z")

</div>

@Axel It seems there is a clash between the “void Error” function from ROOT’s “TError.h” and the “fastjet::Error” class from “fastjet/Error.hh”.

[Previous page](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043.md?page=1)
