🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #72824

C pod Linuxem: redefintion of struct timespec, timeval

#72824
From: Jivanmukta
Date: Fri, 14 Apr 2017 16:34
44 lines
2186 bytes
Napisałem wiele lat temu w języku C program pod Linuxem. Aktualnie 
programuję aplikacje WWW w PHP i słabo pamiętam programowanie w C pod 
Linuxem. Próbuję skompilować plik dpelink.c który zawiera

#include <sys/utsname.h>
#include <sys/types.h>
#include <stdint.h>
#ifdef linux
#include <linux/kernel.h>
#include <linux/sysinfo.h>
#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/coda.h>
#endif
#include "debug.h"
#include "dpelink.h"

i dostaję błędy:

In file included from /usr/include/linux/coda.h:101:0,
                 from dpelink.c:18:
/usr/include/linux/time.h:9:8: error: redefinition of ‘struct timespec’
 struct timespec {
        ^
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:43:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from dpelink.c:11:
/usr/include/time.h:120:8: note: originally defined here
 struct timespec
        ^
In file included from /usr/include/linux/coda.h:101:0,
                 from dpelink.c:18:
/usr/include/linux/time.h:15:8: error: redefinition of ‘struct timeval’
 struct timeval {
        ^
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:45:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from dpelink.c:11:
/usr/include/x86_64-linux-gnu/bits/time.h:30:8: note: originally defined 
here
 struct timeval
        ^

Proszę o pomoc w skompilowaniu programu.
Technical Details
Message-ID: <ocqtn5$qgq$1@gioia.aioe.org>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From: Jivanmukta <jivanmukta@poczta.onet.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: C pod Linuxem: redefintion of struct timespec, timeval
Date: Fri, 14 Apr 2017 18:34:46 +0200
Organization: Aioe.org NNTP Server
Lines: 44
Message-ID: <ocqtn5$qgq$1@gioia.aioe.org>
NNTP-Posting-Host: cnF+CRmxl4Lwehl3qTgVbA.user.gioia.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse@aioe.org
User-Agent: KNode/4.14.2
X-Notice: Filtered by postfilter v. 0.8.2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit