Boost C++ Libraries: Ticket #13527: Boost 1.67.0 - Cannot link to boost_pythonPY_MAJOR_VERSIONPY_MINOR_VERSION... https://svn.boost.org/trac10/ticket/13527 <p> Cannot link to boost_python correctly. Using MSVC 2015 Update 3, boost_1_67_0\boost\python\detail\config.hpp line 108 does not expand as intended: </p> <p> (line 108) #define BOOST_LIB_NAME boost_python##PY_MAJOR_VERSION##PY_MINOR_VERSION </p> <p> This line expands to "boost_pythonPY_MAJOR_VERSIONPY_MINOR_VERSION(...).lib", which results in a linking error since the library is named "boost_python36(...).lib" </p> <p> My Python distribution is Anaconda 5.1 and patchlevel.h has: </p> <p> (line 19) #define PY_MAJOR_VERSION 3 </p> <p> (line 20) #define PY_MINOR_VERSION 6 </p> <p> Similarly, one will have difficulty with boost_1_67_0\boost\python\numpy\config.hpp line 64. </p> <p> I tried repeatedly to make the preprocessor directives work as intended but I cannot quite figure it out. I wish I could find where the library name is generated for the build, not just the link. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13527 Trac 1.4.3 shand_public@… Wed, 18 Apr 2018 14:53:06 GMT <link>https://svn.boost.org/trac10/ticket/13527#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13527#comment:1</guid> <description> <p> I see a similar problem - we use CMake with VS2017 - I see a link error; fatal error LNK1104: cannot open file 'boost_pythonPY_MAJOR_VERSIONPY_MINOR_VERSION-vc141-mt-x64-1_67.lib' </p> <p> Andy </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 08 May 2018 16:47:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13527#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13527#comment:2</guid> <description> <p> There is a bug boost lib. Still waiting for a bugfix. you have to change python/detail/config.hpp. </p> <p> -#define BOOST_LIB_NAME boost_python##PY_MAJOR_VERSION##PY_MINOR_VERSION +#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m +#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m) +#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_python, PY_MAJOR_VERSION, PY_MINOR_VERSION) </p> <p> and after </p> <blockquote> <p> #include &lt;boost/config/auto_link.hpp&gt; #endif <em> auto-linking disabled </em></p> </blockquote> <p> add </p> <p> +#undef BOOST_PYTHON_CONCAT +#undef _BOOST_PYTHON_CONCAT + </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 10 May 2018 16:43:53 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13527#comment:3 https://svn.boost.org/trac10/ticket/13527#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">obsolete</span> </li> </ul> <p> Moved to <a class="ext-link" href="https://github.com/boostorg/python/issues/201"><span class="icon">​</span>https://github.com/boostorg/python/issues/201</a> </p> Ticket