-1

I'm trying to create a chess program using stockfish as an external executable. I'm using C++ in visual studio 2019 with Windows 10. I need to be able to write commands to stockfish, and read its outputs, all whilst my main program runs normally.

Initially, I tried modifying the source code of stockfish and running it on a separate thread. It partly worked, but became very messy with mutexes and shared data.

Now I'm trying to run it as a separate executable. I found this but this solution uses fork and exec, which seem to only exist on Linux.

I also found this but that is only a solution for C#.

Finally, I found this which looks promising. But it also needs the code in the child program, which would be a problem in and of itself. Also, the code is quite long, so I was wondering if that is really the best way to go about this, or is there was a library that would make this easier?

BPDESILVA
  • 2,040
  • 5
  • 15
  • 35
Ben
  • 21
  • 3
  • 1
    UCI is a protocol that you have to follow. No client (engine) modification is required. – Michael Chourdakis Jul 10 '19 at 11:39
  • Yes I realise that now, that's why I'm now trying to use it as a separate executable, but I'm not sure what the easiest way is for me to go about this in my current situation. – Ben Jul 10 '19 at 12:23

1 Answers1

0

After some searching I found a library called boost, specifically boost.process which looks like it has what I need. It can be found here.

Ben
  • 21
  • 3