Neviem ani jednoduchu vec, ako mam spustiť day program (ak sa to da nazvať program) v C.Mam Ubuntu.
Napriklad ako spustim obyčajne "ahoj svet"
Kód: Vybrať všetko
#include <stdio.h>
int main ()
{
printf ("hallo world");
return 0;
}
Kód: Vybrať všetko
#include <stdio.h>
int main ()
{
printf ("hallo world");
return 0;
}
Kód: Vybrať všetko
http://www.codecoffee.com/tipsforlinux/articles/18.html
Kód: Vybrať všetko
gcc -o hello hello.cKód: Vybrať všetko
./helloKód: Vybrať všetko
gcc hello.cAk si dobre pamätám, tak v tomto prípade (gcc bez prepínačov, len s názvom súboru) sa to skompiluje do súboru "a.out", ktorý spustí pomocouxadman napísal: Ak dáš takto:Tak dáš ./hello.cKód: Vybrať všetko
gcc hello.c
Ak nemáš práva, napíš čo to vypisuje.
Kód: Vybrať všetko
./a.out
Kód: Vybrať všetko
.black@black-Inspiron-N5030:~$ gcc -o hello hello.c
gcc: error: hello.c: Adresár alebo súbor neexistuje
gcc: fatal error: no input files
compilation terminated.
black@black-Inspiron-N5030:~$ gcc -o hello hello.c
gcc: error: hello.c: Adresár alebo súbor neexistuje
gcc: fatal error: no input files
compilation terminated.
black@black-Inspiron-N5030:~$
black@black-Inspiron-N5030:~$ ./a.out
bash: ./a.out: Adresár alebo súbor neexistuje
black@black-Inspiron-N5030:~$ ./a.out hallo.c
bash: ./a.out: Adresár alebo súbor neexistuje
black@black-Inspiron-N5030:~$ gcc -o /home/Black/plocha/hello.c
gcc: fatal error: no input files
compilation terminated.
black@black-Inspiron-N5030:~$ gcc -o /home/Black/plocha/hello.c
gcc: fatal error: no input files
compilation terminated.
black@black-Inspiron-N5030:~$ gcc -o hello /home/Black/plocha/hello.c
gcc: error: /home/Black/plocha/hello.c: Adresár alebo súbor neexistuje
gcc: fatal error: no input files
compilation terminated.
black@black-Inspiron-N5030:~$ gcc -o hello.c /home/Black/plocha/hello.c
gcc: error: /home/Black/plocha/hello.c: Adresár alebo súbor neexistuje
gcc: fatal error: no input files
compilation terminated.
black@black-Inspiron-N5030:~$ gcc -o hello.c /home/Black/plocha/hello.cKód: Vybrať všetko
cd Plocha/