Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use precompile header with boost::asio
    primarykey
    data
    text
    <p>I have a project that has some <code>main.cpp</code> and the following precompile header:</p> <pre><code> &lt;!-- language: lang-cpp --&gt; #ifndef PRECOMPILE_H #define PRECOMPILE_H #include &lt;iostream&gt; #include &lt;string&gt; #include &lt;vector&gt; #include &lt;boost\asio.hpp&gt; #include &lt;boost\bind.hpp&gt; #include &lt;boost\asio\ssl.hpp&gt; #include &lt;boost\locale.hpp&gt; #include &lt;boost\algorithm\string.hpp&gt; #endif </code></pre> <p>If the project is <code>*.lib</code>, it always builds normally.</p> <p>If project the is <code>*.exe</code>:<br> When build with <code>Create (/Yc)</code>, all ok.<br> When setting <code>Use (/Yu)</code> <strong>I get linker error</strong> <code>LNK2001</code>:</p> <blockquote> <p>1) unresolved external symbol "private: static class boost::asio::detail::tss_ptr::context> boost::asio::detail::call_stack::top_" (?top_@?$call_stack@Vstrand_impl@strand_service@detail@asio@boost@@E@detail@asio@boost@@0V?$tss_ptr@Vcontext@?$call_stack@Vstrand_impl@strand_service@detail@asio@boost@@E@detail@asio@boost@@@234@A)</p> <p>2) unresolved external symbol "public: static class boost::asio::detail::service_id boost::asio::detail::service_base::id" (?id@?$service_base@Vselect_reactor@detail@asio@boost@@@detail@asio@boost@@2V?$service_id@Vselect_reactor@detail@asio@boost@@@234@A)</p> <p>3) unresolved external symbol "public: static class boost::asio::detail::service_id boost::asio::detail::service_base::id" (?id@?$service_base@Vstrand_service@detail@asio@boost@@@detail@asio@boost@@2V?$service_id@Vstrand_service@detail@asio@boost@@@234@A)</p> <p>4) unresolved external symbol "public: static class boost::asio::detail::service_id > > boost::asio::detail::service_base > >::id" (?id@?$service_base@V?$deadline_timer_service@Vptime@posix_time@boost@@U?$time_traits@Vptime@posix_time@boost@@@asio@3@@asio@boost@@@detail@asio@boost@@2V?$service_id@V?$deadline_timer_service@Vptime@posix_time@boost@@U?$time_traits@Vptime@posix_time@boost@@@asio@3@@asio@boost@@@234@A)</p> </blockquote> <p>Boost: v1_49 static /MTd</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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