Howto use windows engines in linux with xboard.

Here you will find useful links and tricks on how to do special/advanced things under Winboard. Feel free to contribute to this forum.

Moderator: Andres Valverde

Howto use windows engines in linux with xboard.

Postby Daniel Uranga » 07 May 2009, 04:26

I have done an small C/C++ program which prevents wine of being killed when running a windows engine under Xboard. Here the code:
Code: Select all
#include <iostream>
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <cstdlib>
#include <cstring>
using namespace std;

int main ( int argc, char *argv[] )
    int     fd[2];
    pid_t   pid_motor;

    if ( argc==1 )
        cout << "You should use: " << argv[0] << " " << "someEngine.exe" << endl;
        return 1;

    signal(SIGINT, SIG_IGN);
    pipe (fd);

    pid_motor = fork();
    if ( pid_motor==0 )
        char ejecutar[255];
        strcpy ( ejecutar, "wine " );
        strncat ( ejecutar, argv[1], 250);
        system (ejecutar);
        sleep (2);
        int estado;
        wait (&estado);
    return 0;

Is easy to compile it with gcc. After that simply "./thisProgram windowsEngine.exe".
Hope will be helpful to someone.
Daniel Uranga
Posts: 26
Joined: 01 Apr 2009, 05:15

Return to How To & Useful Links

Who is online

Users browsing this forum: No registered users and 1 guest