libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
532 stars 304 forks source link

Node.cpp:21:10: fatal error: 'cstdlib' file not found #167

Closed Merculous closed 3 years ago

Merculous commented 4 years ago

OS: Ubuntu 18.04.4

I've managed to fix this before by setting some environment variable(s), but I forgot what I did.

libtoolize: putting auxiliary files in '.'. libtoolize: linking file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: linking file 'm4/libtool.m4' libtoolize: linking file 'm4/ltoptions.m4' libtoolize: linking file 'm4/ltsugar.m4' libtoolize: linking file 'm4/ltversion.m4' libtoolize: linking file 'm4/lt~obsolete.m4' checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking for gcc... clang checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether clang accepts -g... yes checking for clang option to accept ISO C89... none needed checking whether clang understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of clang... gcc3 checking whether we are using the GNU C++ compiler... yes checking whether clang++ accepts -g... yes checking dependency style of clang++... gcc3 checking whether clang++ is available and compiles a program... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by clang... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... no checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from clang object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... clang -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if clang supports -fno-rtti -fno-exceptions... yes checking for clang option to produce PIC... -fPIC -DPIC checking if clang PIC flag -fPIC -DPIC works... yes checking if clang static flag -static works... yes checking if clang supports -c -o file.o... yes checking if clang supports -c -o file.o... (cached) yes checking whether the clang linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... no checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... clang++ -E checking for ld used by clang++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the clang++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for clang++ option to produce PIC... -fPIC -DPIC checking if clang++ PIC flag -fPIC -DPIC works... yes checking if clang++ static flag -static works... no checking if clang++ supports -c -o file.o... yes checking if clang++ supports -c -o file.o... (cached) yes checking whether the clang++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for ANSI C header files... (cached) yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for an ANSI C-conforming const... yes checking for size_t... yes checking for ssize_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint8_t... yes checking for asprintf... yes checking for strcasecmp... yes checking for strdup... yes checking for strerror... yes checking for strndup... yes checking for stpcpy... yes checking for vasprintf... yes checking for gmtime_r... yes checking for localtime_r... yes checking for timegm... yes checking for strptime... yes checking for memmem... yes checking whether byte ordering is bigendian... no checking wether we need platform-specific build settings for linux-gnu... yes checking whether clang is Clang... yes checking whether Clang needs flag to prevent "argument unused" warning when linking with -pthread... no checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking whether more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking for pthread_once in -lpthread... yes checking if fmin is a builtin function... yes checking for tm_gmtoff in struct tm... yes checking for tm_zone in struct tm... yes checking for a Python interpreter with version >= 2.3... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking for cython... /usr/bin/cython checking for Cython version... 0.26.1 configure: Cython executable is '/usr/bin/cython' checking for python2.7... (cached) /usr/bin/python checking for a version of Python >= '2.1.0'... yes checking for the distutils Python package... yes checking for Python include path... -I/usr/include/python2.7 checking for Python library path... -L/usr/lib -lpython2.7 checking for Python site-packages path... /usr/lib/python2.7/dist-packages checking python extra libraries... -lpthread -ldl -lutil -lm checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions checking consistency of all components of python development environment... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for libplist Cython bindings... /usr/local/include/plist/cython checking for supported compiler flags... -Wall -Wextra -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -Wno-strict-aliasing -fvisibility=hidden -pthread checking whether make supports nested variables... (cached) yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating libcnary/Makefile config.status: creating src/Makefile config.status: creating src/libplist-2.0.pc config.status: creating src/libplist++-2.0.pc config.status: creating include/Makefile config.status: creating tools/Makefile config.status: creating docs/Makefile config.status: creating cython/Makefile config.status: creating test/Makefile config.status: creating fuzz/Makefile config.status: creating doxygen.cfg config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands

Configuration for libplist 2.2.1:

Install prefix ..........: /usr/local Debug code ..............: no Python bindings .........: yes

Now type 'make' to build libplist 2.2.1, and then 'make install' for installation.

make all-recursive make[1]: Entering directory '/home/merculous/Documents/libplist' Making all in libcnary make[2]: Entering directory '/home/merculous/Documents/libplist/libcnary' CC node.lo CC node_list.lo CCLD libcnary.la warning: ranlib: warning for library: .libs/libcnary.a the table of contents is empty (no object file members in the library define global symbols) make[2]: Leaving directory '/home/merculous/Documents/libplist/libcnary' Making all in src make[2]: Entering directory '/home/merculous/Documents/libplist/src' CC base64.lo CC bytearray.lo CC hashtable.lo CC ptrarray.lo CC time64.lo CC xplist.lo CC bplist.lo CC plist.lo CCLD libplist-2.0.la warning: ranlib: warning for library: .libs/libplist-2.0.a the table of contents is empty (no object file members in the library define global symbols) CXX Node.lo Node.cpp:21:10: fatal error: 'cstdlib' file not found

include

     ^~~~~~~~~

1 error generated. Makefile:595: recipe for target 'Node.lo' failed make[2]: [Node.lo] Error 1 make[2]: Leaving directory '/home/merculous/Documents/libplist/src' Makefile:442: recipe for target 'all-recursive' failed make[1]: [all-recursive] Error 1 make[1]: Leaving directory '/home/merculous/Documents/libplist' Makefile:372: recipe for target 'all' failed make: *** [all] Error 2

Merculous commented 4 years ago

Ok, so running ./configure CC=gcc CXX=g++ will fix this issue. Seems like clang is either messed up for me or just not working at all for me. I think that's how I fixed the issue the last time.

After compiling, linking fails. I have compiled before so its failing to link against my latest compiled libraries.

Making install in libcnary make[1]: Entering directory '/home/merculous/Documents/libplist/libcnary' make[2]: Entering directory '/home/merculous/Documents/libplist/libcnary' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/home/merculous/Documents/libplist/libcnary' make[1]: Leaving directory '/home/merculous/Documents/libplist/libcnary' Making install in src make[1]: Entering directory '/home/merculous/Documents/libplist/src' make[2]: Entering directory '/home/merculous/Documents/libplist/src' /bin/mkdir -p '/usr/local/lib' /bin/bash ../libtool --mode=install /usr/bin/install -c libplist-2.0.la libplist++-2.0.la '/usr/local/lib' libtool: install: /usr/bin/install -c .libs/libplist-2.0.so.3.3.0 /usr/local/lib/libplist-2.0.so.3.3.0 libtool: install: (cd /usr/local/lib && { ln -s -f libplist-2.0.so.3.3.0 libplist-2.0.so.3 || { rm -f libplist-2.0.so.3 && ln -s libplist-2.0.so.3.3.0 libplist-2.0.so.3; }; }) libtool: install: (cd /usr/local/lib && { ln -s -f libplist-2.0.so.3.3.0 libplist-2.0.so || { rm -f libplist-2.0.so && ln -s libplist-2.0.so.3.3.0 libplist-2.0.so; }; }) libtool: install: /usr/bin/install -c .libs/libplist-2.0.lai /usr/local/lib/libplist-2.0.la libtool: warning: relinking 'libplist++-2.0.la' libtool: install: (cd /home/merculous/Documents/libplist/src; /bin/bash "/home/merculous/Documents/libplist/libtool" --silent --tag CXX --mode=relink g++ -g -O2 -lm -version-info 6:0:3 -no-undefined -o libplist++-2.0.la -rpath /usr/local/lib Node.lo Structure.lo Array.lo Boolean.lo Data.lo Date.lo Dictionary.lo Integer.lo Key.lo Real.lo String.lo Uid.lo libplist-2.0.la -lpthread ) ld: warning: directory not found for option '-F/System/Library/Frameworks/' ld: unknown option: -plugin collect2: error: ld returned 1 exit status libtool: error: error: relink 'libplist++-2.0.la' with the above command before installing it Makefile:492: recipe for target 'install-libLTLIBRARIES' failed make[2]: [install-libLTLIBRARIES] Error 1 make[2]: Leaving directory '/home/merculous/Documents/libplist/src' Makefile:723: recipe for target 'install-am' failed make[1]: [install-am] Error 2 make[1]: Leaving directory '/home/merculous/Documents/libplist/src' Makefile:442: recipe for target 'install-recursive' failed make: *** [install-recursive] Error 1

Merculous commented 3 years ago

Ok, compiling binutils from source fixed this issue (worked without clang).