Including Boost Python libraries produces C2039 compiler error
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Reproduce the include failure with Boost 1.76, MSVC v143, C++17, and Python 3.7, then inspect boost/core/cmath.hpp alongside boost/python.hpp, boost/python/numpy.hpp, and boost/python/detail/wrap_python.py. Confirm the cause of the missing std::_copysign declaration and verify that the affected Boost headers compile under the reported configuration.
Written by the indexing model from the issue text.
Description
I have built Boost_1.76 with the following configurations.
Compiler: MSVC 143
Build Tools: bootstrap.bat, b2 engine
Python Version: 3.7
b2 Command: b2 --build-dir=build/x64 address-model=64 threading=multi --build-type=complete --stagedir=./stage/x64 -j 12
// Conversion.hpp
#include <boost/python.hpp> // import produces C2039
#include <boost/python/numpy.hpp> // import produces C2039
#include <boost/tuple/tuple.hpp>
#include <boost/shared_ptr.hpp>
// Conversion.cpp
#include "Conversion.hpp" // importing the header file produces the compiler error
I am compiling the project with the following specs.
Compiler: MSVC cl.exe
C++ Standard: ISO C++17
Platform Toolset: Visual Studio 2022 (v143)
The compilation generates the following error.
C2039: '_copysign' is not a member of 'std'
File: boost_1_76_python37\boost\core\cmath.hpp
I looked at python.hpp and numpy.hpp and could only find a reference to std::cmath inside boost\python\detail\wrap_python.py, which is used over boost::core::cmath. I checked the std::cmath header and copysign is neither declared nor defined. How do I make sure that my Boost library uses the copysign in boost::core::cmath?
- Dominant language
- C++
- Stars
- 156
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/core
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
saturate_cast Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·