Your issue is that after chroot, the binary ./test is no longer found inside the new root (.).
chroot changes the apparent root directory for the process.
Copy test into the root of the jail:
cp ./test ./testdir/test
sudo ./penaur ./testdir
and change your c++ call:
sandbox.run("/test");