title: Boost with Qt Creator
body: <p>I was trying to use boost/filesystem in my C++ project made with QtCreator.
  The problem was that when building, I got the following error:</p>
  
  <pre><code>"error: undefined reference to `boost::system::generic_category()'"
  </code></pre>
  
  <p>To use boost, I had performed the following actions:</p>
  
  <ul>
  <li>download boost library boost_1_73_0.7z file</li>
  <li>unzip it in my computer (under D:\Development\Boost)</li>
  <li><p>in .pro file, I have added the following option</p>
  
  <p>INCLUDEPATH += D:/Development/Boost</p></li>
  <li><p>in my .cpp file, I have added the following include</p>
  
  <p>#include "boost/filesystem.hpp"</p></li>
  <li><p>At this point, when compiling, I had the following error in Qt creator IDE</p>
  
  <p>"error: undefined reference to `boost::system::generic_category()'"</p></li>
  </ul>
  
  <p>The root cause is the following : FileSystem needs to be built. Therefore, I have built this boost library by :</p>
  
  <ul>
  <li>adding gcc and g++ to the path variable (it is succesful as I could call 'g++' and 'gcc' from the command prompt).</li>
  <li>opening Qt command prompt (I used Qt 5.15.0 (MinGW 73.0 64-bit) ) and by navigating to the repository where boost is installed.</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/89F1x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/89F1x.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>executing the following command in the command prompt in the directory (D:\Development\Boost): <strong>bootstrap gcc</strong></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/qYscA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qYscA.png" alt="enter image description here"></a></p>
  
  <ul>
  <li><p>executing the following command in the command prompt in the directory where I had unzipped Boost: <strong>b2 toolset=gcc link=shared threading=multi --build-type=complete stage</strong>. This action has created a the directory <strong>D:\develoment\Boost\Stage\lib</strong> with all the dll, including 'libboost_filesystem-mgw8-mt-d-x64-1_73.dll'.</p></li>
  <li><p>Now it's time to link the library in Qt creator. I have thus added the following in my .pro file:</p>
  
  <p>LIBS += -LD:/Development/Boost/stage/lib libboost_filesystem-mgw8-mt-d-x64-1_73</p></li>
  </ul>
  
  <p>When compiling, the error is gone. </p>
  
  <p>Thanks for your help.
  Gatien</p>