LINUX.ORG.RU

ошибка при компиляции (С++)


0

0

При компиляции вылазит вот это:

[ckult@localhost png]$ make
if /bin/sh ../../libtool --silent --mode=compile g++ -DPACKAGE_NAME=\"ksquirrel-libs\" -DPACKAGE_TARNAME=\"ksquirrel-libs\" -DPACKAGE_VERSION=\"0.5.0\" -DPACKAGE_STRING=\"ksquirrel-libs\ 0.5.0\" -DPACKAGE_BUGREPORT=\"squirrel-sf@yandex.ru\" -D_GNU_SOURCE=1 -DPACKAGE=\"ksquirrel-libs\" -DVERSION=\"0.5.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSTDC_HEADERS=1 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STDLIB_H=1 -DHAVE_REALLOC=1 -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_MEMSET=1 -DHAVE_MEMCPY=1 -DHAVE_SETJMP=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBPNG=1 -DHAVE_JPEGLIB_H=1 -DHAVE_JCONFIG_H=1 -DHAVE_JERROR_H=1 -DHAVE_JMORECFG_H=1 -DHAVE_PNG_H=1 -I. -I. -I.. -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -MT read_png.lo -MD -MP -MF ".deps/read_png.Tpo" -c -o read_png.lo read_png.cpp; \
then mv -f ".deps/read_png.Tpo" ".deps/read_png.Plo"; else rm -f ".deps/read_png.Tpo"; exit 1; fi
In file included from /usr/include/stdlib.h:43,
from read_png.cpp:24:
/usr/include/bits/waitstatus.h:78: error: declaration of `unsigned int wait::<anonymous struct>::__w_retcode'
/usr/include/bits/waitstatus.h:73: error: conflicts with previous declaration `unsigned int wait::<anonymous struct>::__w_retcode'
/usr/include/bits/waitstatus.h:79: error: declaration of `unsigned int wait::<anonymous struct>::__w_coredump'
/usr/include/bits/waitstatus.h:72: error: conflicts with previous declaration `unsigned int wait::<anonymous struct>::__w_coredump'
/usr/include/bits/waitstatus.h:80: error: declaration of `unsigned int wait::<anonymous struct>::__w_termsig'
/usr/include/bits/waitstatus.h:71: error: conflicts with previous declaration `unsigned int wait::<anonymous struct>::__w_termsig'
/usr/include/bits/waitstatus.h:92: error: declaration of `unsigned int wait::<anonymous struct>::__w_stopsig'
/usr/include/bits/waitstatus.h:87: error: conflicts with previous declaration `unsigned int wait::<anonymous struct>::__w_stopsig'
/usr/include/bits/waitstatus.h:93: error: declaration of `unsigned int wait::<anonymous struct>::__w_stopval'
/usr/include/bits/waitstatus.h:86: error: conflicts with previous declaration `unsigned int wait::<anonymous struct>::__w_stopval'
make: *** [read_png.lo] Ошибка 1

Makefile.am такой:

INCLUDES = -I..

lib_LTLIBRARIES = libSQ_read_png.la
libSQ_read_png_la_SOURCES = read_png.cpp read_png.h

EXTRA_DIST = read_png.cpp read_png.h

libSQ_read_png_la_LDFLAGS = -release 1.1.0

LIBS = -lpng

**************************
В чём дело ?


>In file included from /usr/include/stdlib.h:43,

хмм....а
#include <stdlib.h>
int main () {}

компилится? (команда gcc file.c)

theserg ★★★
()
Ответ на: комментарий от theserg

уже разобрался, хоть потратил час :) Оказывается всё дело в #ifdef-ах, надо было определить _SYS_TIME_H :)

Krasu
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.