I am trying to compile a C project that I wrote while I used windows. I am trying to compile same project with same IDE (Code::Blocks) in Linux (Ubuntu 12.04). I have several System("CLS") functions used in my program. But the linux console says
sh: 1:CLS: not found
Segmentation fault (core dumped)
I have included <stdlib.h> and <stdio.h> (and several of course).
I am trying to compile a C project that I wrote while I used
Share
The problem is that the command CLS does only exist on Windows. For Linux, the command you want is:
clear.Anyway, that will only partially solve the problem: a) you’ll have the same problem if you port your program to a windows machine, and b) there is no reason for that to produce a segmentation fault.