🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.os.linux.programowanie
3 messages
3 total messages Started by Jivanmukta Fri, 14 Apr 2017 16:34
C pod Linuxem: redefintion of struct timespec, timeval
#72824
Author: 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.
Re: C pod Linuxem: redefintion of struct timespec, timeval
#72825
Author: Jivanmukta
Date: Sat, 15 Apr 2017 04:24
5 lines
905 bytes
Jivanmukta wrote:
> Proszę o pomoc w skompilowaniu programu.

Moje problemy pojawiły się po tym jak zmieniłem include statfs.h na coda.h. 
Nie wiecie co się stało z statfs.h w Linuxie?
Re: C pod Linuxem: redefintion of struct timespec, timeval
#72826
Author: Jivanmukta
Date: Sat, 15 Apr 2017 04:32
6 lines
1025 bytes
Jivanmukta wrote:
> Moje problemy pojawiły się po tym jak zmieniłem include statfs.h na
> coda.h. Nie wiecie co się stało z statfs.h w Linuxie?

Dobra, poradziłem sobie - trzeba było użyć asm-generic/statfs.h zamiast 
linux/coda.h. Problem zamknięty.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads