gym-http-api icon indicating copy to clipboard operation
gym-http-api copied to clipboard

C++-Bindings - Example does not run

Open kschoos opened this issue 7 years ago • 3 comments

After installing all the prerequisites and trying to run the random_agent.cpp in cpp bindings, it threw an Error, saying it cannot convert a certain value to float. Changing from Breakout-v0 to CartPole-v0 made it work for the time being.

kschoos avatar Dec 17 '17 14:12 kschoos

@kschoos how did you compile and run the C++ example? I'm unable to compile (OSX 10.14):

$ g++ -o gym_exec random_agent.cpp -I include/gym/
Undefined symbols for architecture x86_64:
  "Gym::client_create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _main in random_agent-0dd3a4.o
  "Gym::Space::sample()", referenced from:
      run_single_environment(boost::shared_ptr<Gym::Client> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in random_agent-0dd3a4.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

BoltzmannBrain avatar Sep 30 '18 01:09 BoltzmannBrain

Found an old makefile here.

BoltzmannBrain avatar Oct 04 '18 02:10 BoltzmannBrain

The implementation does not support 3D states, i.e., image inputs. You need to call Breakout-ram-v0.

After installing all the prerequisites and trying to run the random_agent.cpp in cpp bindings, it threw an Error, saying it cannot convert a certain value to float. Changing from Breakout-v0 to CartPole-v0 made it work for the time being.

oroojlooy avatar Feb 12 '19 21:02 oroojlooy