|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Oct 2007
Messaggi: 48
|
[C] Compilare codice per Linux
Cari esperti buongiorno, sono un utente del tutto nuovo al mondo di Linux e mi trovo al cospetto di un problema che da solo non riesco proprio a risolvere.
Ho installato Ubuntu per eseguire un codice scritto in C che gira solo sotto Linux, ma che devo cercare di far funzionare per continuare a lavorare alla mia tesi. Il programma in questione è composto dalla seguente lista di files: arith.c bmc.c constants.h datatypes.h Makefile probe.c protocol.c ptpd.c ptpd.h \dep\constants_dep.h \dep\datatypes_dep.h \dep\msg.c \dep\net.c \dep\ptpd_dep.h \dep\servo.c \dep\startup.c \dep\sys.c \dep\timer.c Ma quando nella finestra del terminale, effettuando il login come "root", digito la stringa: "gcc -c ptpd.c -o ptpd" Ottengo il seguente risultato: ------------------------------------------------------ In file included from ptpd.h:7, from ptpd.c:3: dep/constants_dep.h:13:23: error: netinet/in.h: No such file or directory dep/constants_dep.h:14:19: error: net/if.h: No such file or directory dep/constants_dep.h:15:23: error: net/if_arp.h: No such file or directory dep/constants_dep.h:21:19: error: endian.h: No such file or directory In file included from ptpd.h:9, from ptpd.c:3: datatypes.h:332: error: ‘IF_NAMESIZE’ undeclared here (not in a function) datatypes.h:337: error: ‘INET_ADDRSTRLEN’ undeclared here (not in a function) In file included from ptpd.h:10, from ptpd.c:3: dep/ptpd_dep.h:6:19: error: stdlib.h: No such file or directory dep/ptpd_dep.h:7:18: error: stdio.h: No such file or directory dep/ptpd_dep.h:8:19: error: string.h: No such file or directory dep/ptpd_dep.h:9:19: error: unistd.h: No such file or directory dep/ptpd_dep.h:10:18: error: errno.h: No such file or directory dep/ptpd_dep.h:11:19: error: signal.h: No such file or directory dep/ptpd_dep.h:12:18: error: fcntl.h: No such file or directory dep/ptpd_dep.h:13:21: error: sys/stat.h: No such file or directory dep/ptpd_dep.h:14:17: error: time.h: No such file or directory dep/ptpd_dep.h:15:21: error: sys/time.h: No such file or directory dep/ptpd_dep.h:16:22: error: sys/timex.h: No such file or directory dep/ptpd_dep.h:17:23: error: sys/socket.h: No such file or directory dep/ptpd_dep.h:18:23: error: sys/select.h: No such file or directory dep/ptpd_dep.h:19:22: error: sys/ioctl.h: No such file or directory dep/ptpd_dep.h:20:22: error: arpa/inet.h: No such file or directory In file included from ptpd.h:10, from ptpd.c:3: dep/ptpd_dep.h:81: error: expected declaration specifiers or ‘...’ before ‘ssize_t’ dep/ptpd_dep.h:103: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘netRecvEvent’ dep/ptpd_dep.h:104: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘netRecvGeneral’ dep/ptpd_dep.h:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘netSendEvent’ dep/ptpd_dep.h:106: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘netSendGeneral’ ptpd.c: In function ‘main’: ptpd.c:14: warning: incompatible implicit declaration of built-in function ‘memcpy’ ptpd.c:43: warning: incompatible implicit declaration of built-in function ‘fprintf’ ptpd.c:43: error: ‘stderr’ undeclared (first use in this function) ptpd.c:43: error: (Each undeclared identifier is reported only once ptpd.c:43: error: for each function it appears in.) -------------------------------------------- Qualora qualche anima candida volesse provare direttamente il codice, questo è disponibile al seguente indirizzo: ptpd.sourceforge.net Grazie per l'aiuto! |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Digita:
sudo apt-get install build-essential make |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 21:28.