aquemini
aquemini

Reputation: 960

System Call Issues in C++

I'm writing software that requires a system call to Weka at the bginning of main(). The call is as follows:

printf("Creating neural netowrk...\n");
system("\" java -cp \"FILEPATH\weka.jar\" weka.classifiers.functions.MultilayerPerceptron -t \"ML_data.arff\" -d \"MLPnn.model\" \""); 
printf("Neural network created.\n");

But the console pops up with Creating neural network... and never advances.

I've tried just entering the command into the window itself, and it works fine. I'm pretty sure all my filepaths/quotes are right, because I had trouble with them before and it gave me errors. Now it just appears that the program is stuck.

It should be noted that this system call has worked before, and remains unchanged. The program around it has changed immensely, but as I said, this is literally the first set of instructions that gets executed.

Is there a way to troubleshoot this, or a common solution to the problem? I don't have a very good idea of the inner machinations of system calls, and wonder what could be the underlying cause (memory, hardware, etc.).

Upvotes: 1

Views: 253

Answers (1)

ruizpauker
ruizpauker

Reputation: 384

Try:

system("java -cp \"FILEPATH\\weka.jar\" weka.classifiers.functions.MultilayerPerceptron -t \"ML_data.arff\" -d \"MLPnn.model\" "); 

Just removed the first '\"' and added an extra '\' after FILEPATH.

Upvotes: 1

Related Questions