Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I resolve LNK1104 error with Boost Filesystem Library in MSCV?
    text
    copied!<p>I am having trouble getting my project to link to the Boost (version 1.37.0) Filesystem lib file in Microsoft Visual C++ 2008 Express Edition. The Filesystem library is <b>not</b> a header-only library. I have been following the <i><a href="http://www.boost.org/doc/libs/1_37_0/more/getting_started/windows.html" rel="nofollow noreferrer">Getting Started on Windows</a></i> guide posted on the official boost web page. Here are the steps I have taken:</p> <ol> <li><p>I used bjam to build the complete set of lib files using:</p> <pre><code>bjam --build-dir="C:\Program Files\boost\build-boost" --toolset=msvc --build-type=complete </code></pre></li> <li><p>I copied the <i>/libs</i> directory (located in <i>C:\Program Files\boost\build-boost\boost\bin.v2</i>) to <i>C:\Program Files\boost\boost_1_37_0\libs.</i></p></li> <li><p>In Visual C++, under <i>Project > Properties > Additional Library Directories</i> I added these paths:</p> <ul> <li><i>C:\Program Files\boost\boost_1_37_0\libs</i></li> <li><i>C:\Program Files\boost\boost_1_37_0\libs\filesystem\build\msvc-9.0express\debug\link-static\threading-multi</i></li> </ul> <p>I added the second one out of desperation. It is the exact directory where <i>libboost_system-vc90-mt-gd-1_37.lib</i> resides.</p></li> <li><p>In <i>Configuration Properties > C/C++ > General > Additional Include Directories</i> I added the following path:</p> <ul> <li><i>C:\Program Files\boost\boost_1_37_0</i></li> </ul></li> <li><p>Then, to put the icing on the cake, under <i>Tools > Options VC++ Directories > Library files</i>, I added the same directories mentioned in step 3.</p></li> </ol> <p>Despite all this, when I build my project I get the following error:</p> <pre><code>fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_37.lib' </code></pre> <p>Additionally, here is the code that I am attempting to compile as well as a screen shot of the aformentioned directory where the (assumedly correct) lib file resides:</p> <pre><code>#include "boost/filesystem.hpp" // includes all needed Boost.Filesystem declarations #include &lt;iostream&gt; // for std::cout using boost::filesystem; // for ease of tutorial presentation; // a namespace alias is preferred practice in real code using namespace std; int main() { cout &lt;&lt; "Hello, world!" &lt;&lt; endl; return 0; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload