nnarain / gameboycore-python

Python Bindings for GameboyCore
MIT License
5 stars 2 forks source link

ArgumentError when calling GameboyCore.open() #19

Closed max-vogler closed 6 years ago

max-vogler commented 6 years ago

Thanks for your support with the gameboycore-python setup 👍I installed the package like in https://github.com/nnarain/gameboycore-python/issues/11#issuecomment-353902756 using Debian, Python 3.6, Boost 1.60.0, GameboyCore-Python 0.4.5

Now I get an error with a minimal example in GameboyCore.open:

import gameboycore

core = gameboycore.GameboyCore()
core.open("something")
Traceback (most recent call last):
  File "example.py", line 10, in <module>
    core.open("roms/infinity.gb")
Boost.Python.ArgumentError: Python argument types in
    GameboyCore.open(GameboyCore, str)
did not match C++ signature:
    open(GameboyCorePython {lvalue}, std::string)
nnarain commented 6 years ago

Wasn't able to reproduce on my Debian VM. But I have a thought of what it could be.

If you don't mind. Have a look here.

Try changing boost::noncopyable to boost::shared_ptr<GameboyCore> and then re-compile.

shimpooky commented 6 years ago

I ran into the same problem today. Ubuntu 18.04, Python 3.6.6, Boost 1.60.0, gameboycore-python 0.4.5 With the suggested fix, I run into a new problem while rebuilding:


../root/gameboycore-python/src/python/gameboycore_module.cpp:53:60: error: template argument 2 is invalid
     class_<GameboyCorePython, boost::shared_ptr<GameboyCore>>("GameboyCore")
                                                            ^~
nnarain commented 6 years ago

Ya, the above was just a suggestion as I could not reproduce.

Can you post your python script and error output?

shimpooky commented 6 years ago

It's actually the same code and error as OP's. Whatever I try (like your example), I just end up running into the same error once I get to core.open("rom.gb")

nnarain commented 6 years ago

Issues were most likely Boost.Python related. I've recently moved the project over to pybind11.

You can install from source on linux.

git clone https://github.com/nnarain/gameboycore-python
cd gameboycore-python
pip install -e .