unbekannte Fehlermeldung

K

khauer

Grünschnabel
hallo,

ich versuche folgendes Prgogramm zu übersetzen:

#include <stdio.h> /* Standard input/output definitions */
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#include <fcntl.h> /* File control definitions */
#include <errno.h> /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */

/*
* 'open_port()' - Open serial port 1.
*
* Returns the file descriptor on success or -1 on error.
*/

int open_port(void)
{
int fd; /* File descriptor for the port */


fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1)
{
/*
* Could not open the port.
*/

perror("open_port: Unable to open /dev/ttyS0 - ");
}
else
fcntl(fd, F_SETFL, 0);

return (fd);
}

die kompilierung erfolgt mit;

gcc -o Test Test_2.c

und dabei erhaltene ich folgende Fehlermeldung:

/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld gab 1 als Ende-Status zurück


wo liegt der Fehler
 
Hast Du hier vielleicht das Hauptprogramm namens main() vergessen, das substantieller Bestandteil JEDES C-Programms ist?

HTH Aqualung
 
Zuletzt bearbeitet:
scheiße du hast recht. ich sollte mich einsargen lassen.
 
:)

Bist nicht der erste/einzige, dem sowas mal passiert :P (falls es dich beruhigt :D )
 

Ähnliche Themen

NGINX bietet intern abgerufene Seiten nur zum Download an, extern geht's

Nginx als Reverse Proxy für Nextcloud und Emby

Unix Webserver mit HTML Seite erstellen

Samba 4 Gast Zugang unter Ubuntu funktioniert nicht

Akonadi startet nicht mehr

Zurück
Oben