dimanche 29 décembre 2019

Unable to set OS for Nodejs Library Compilex

I am using Compilex library of nodejs to build an online judge. I am using Ubuntu and installed the library using npm install compilex. By default the OS is set to be Windows inside the server.js file of the demo webpage( which is provided upon installing compilex).

(Source: Documentation of Compilex)

//if windows  
var envData = { OS : "windows" , cmd : "g++"}; // (uses g++ command to compile )
//else
var envData = { OS : "linux" , cmd : "gcc" }; // ( uses gcc command to compile )
compiler.compileCPP(envData , code , function (data) {
    res.send(data);
    //data.error = error message 
    //data.output = output value
});

Basically upon starting the server the library creates a temp folder and all the input data and executable files are stored in it. The hosting machine must contain the required compilers. I tried changing it from "windows" to "linux"(inside the server.js file) but it doesn't work. Even upon changing, the temp folder has .exe files.

How do I resolve this?




Aucun commentaire:

Enregistrer un commentaire