- 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);
}
else
{
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.