-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal Boost Python example not working #437
Comments
The code above looks fine. I suspect the problem stems from the way this is compiled. Can you share the details of your build & execution environment ? I.e., platform, compiler, build commands, etc. |
Thanks for your quick reply! I'm on Windows 11, using the compiler shipped with Visual Studio 17 2022, toolset v142. Also I use Ninja as the generator. To compile from the build folder activate my conda environment and I just do
I get boost 1.84 from Conda-forge. My CMakeLists file that finds boost has:
I then link boost to the library that requires it. Perhaps I am missing a component of boost or python? |
My conda env is created using this:
|
I've tried creating a minimal example here, but it seems to be struggling to build. Any ideas why? robertapplin/boost-example#2 |
Not sure exact solution but can you try using something other than std::string e.g int, this will likely mean that your code does not find/accept converter for const std::string&. Also why not python 3.11.. |
It works for an I've also tried with python 3.10, and 3.11 - the same problem happens |
this is what I'm using to print |
I'm having trouble getting boost python to work with this minimal example. I've emailed the mailing list but have had no response.
I'm using C++20
This compiles fine, but I get a segmentation fault when I attempt to call the function from python (using 3.10):
The output I get:
Can you tell me what I'm doing wrong? Thanks in advance
The text was updated successfully, but these errors were encountered: