tihmstar / usbmuxd2

A socket daemon written in C++ to multiplex connections from and to iOS devices over USB and WIFI
GNU Lesser General Public License v3.0
181 stars 38 forks source link

Error when trying to make usbmuxd2 #26

Closed jarredAwesome closed 6 months ago

jarredAwesome commented 1 year ago

I am trying to compile usbmxd2 on my Raspi 4. I'm running buster on Rasbian lite

When I do "./autogen.sh" I get the following:

`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' configure.ac:11: installing './compile' configure.ac:12: installing './missing' usbmuxd2/Makefile.am:10: warning: AM_CFLAGS was already defined in condition !DEBUG, which is included in condition TRUE ... usbmuxd2/Makefile.am:6: ... 'AM_CFLAGS' previously defined here usbmuxd2/Makefile.am:11: warning: AM_CXXFLAGS was already defined in condition !DEBUG, which is included in condition TRUE ... usbmuxd2/Makefile.am:7: ... 'AM_CXXFLAGS' previously defined here usbmuxd2/Makefile.am: installing './depcomp' checking build system type... armv7l-unknown-linux-gnueabihf checking host system type... armv7l-unknown-linux-gnueabihf checking target system type... armv7l-unknown-linux-gnueabihf checking how to print strings... printf checking for gcc... no checking for cc... cc 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 cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking whether cc understands -c and -o together... yes checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by cc... /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 armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop checking how to convert armv7l-unknown-linux-gnueabihf 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... @ checking for strip... strip checking for ranlib... ranlib checking for gawk... no checking for mawk... mawk checking command to parse /usr/bin/nm -B output from cc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/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... cc -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 cc supports -fno-rtti -fno-exceptions... yes checking for cc option to produce PIC... -fPIC -DPIC checking if cc PIC flag -fPIC -DPIC works... yes checking if cc static flag -static works... yes checking if cc supports -c -o file.o... yes checking if cc supports -c -o file.o... (cached) yes checking whether the cc linker (/usr/bin/ld) 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... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking whether make sets $(MAKE)... yes checking whether make supports the include directive... yes (GNU style) checking whether make supports nested variables... yes checking dependency style of cc... gcc3 checking for g++... no checking for c++... c++ checking whether we are using the GNU C++ compiler... yes checking whether c++ accepts -g... yes checking how to run the C++ preprocessor... c++ -E checking for ld used by c++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes checking for c++ option to produce PIC... -fPIC -DPIC checking if c++ PIC flag -fPIC -DPIC works... yes checking if c++ static flag -static works... yes checking if c++ supports -c -o file.o... yes checking if c++ supports -c -o file.o... (cached) yes checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking dependency style of c++... gcc3 checking whether we are using the GNU C compiler... (cached) yes checking whether cc accepts -g... (cached) yes checking for cc option to accept ISO C89... (cached) none needed checking whether cc understands -c and -o together... (cached) yes checking whether we need platform-specific build settings... checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for libgeneral... yes checking for libusb... yes checking for libplist... yes checking for libimobiledevice... yes checking for avahi... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking filesystem usability... no checking filesystem presence... no checking for filesystem... no checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking for size_t... yes checking for ssize_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for clock_gettime... yes checking for gettimeofday... yes checking for memset... yes checking for socket... yes checking for strdup... yes checking for strerror... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating udev/Makefile config.status: creating systemd/Makefile config.status: creating usbmuxd2/Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing libtool commands config.status: executing depfiles commands

Configuration for usbmuxd2-46:

install prefix ..........: /usr/local Debug build .............: false preflight support .......: yes WIFI support ............: yes activation method .......: systemd WIFI backend ............: avahi systemd unit directory ..: /lib/systemd/system udev rules directory ....: /lib/udev/rules.d compiler ................: cc ` but when I do make, I get errors:

(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/pi/nMirror/usbmuxd2/missing autoheader) rm -f stamp-h1 touch config.h.in cd . && /bin/bash ./config.status config.h config.status: creating config.h config.status: config.h is unchanged make all-recursive make[1]: Entering directory '/home/pi/nMirror/usbmuxd2' Making all in usbmuxd2 make[2]: Entering directory '/home/pi/nMirror/usbmuxd2/usbmuxd2' c++ -DHAVE_CONFIG_H -I. -I.. -I../usbmuxd2 -I/usr/local/include -I/usr/include/libusb-1.0 -I/usr/local/include -g -O2 -DCUSTOM_LOGGING="\"log.h\"" -std=c++17 -MT usbmuxd-Client.o -MD -MP -MF .deps/usbmuxd-Client.Tpo -c -o usbmuxd-Client.otest -f 'Client.cpp' || echo './'`Client.cpp Client.cpp:292:21: error: no matching function for call to 'plist_from_memory' plist_from_memory(pairRecord, (uint32_t)pairRecord_len, &p_parsedPairRecord); ^~~~~ /usr/local/include/plist/plist.h:846:27: note: candidate function not viable: requires 4 arguments, but 3 were provided PLIST_API plist_err_t plist_from_memory(const char *plist_data, uint32_t length, plist_t ... ^ 1 error generated. make[2]: [Makefile:633: usbmuxd-Client.o] Error 1 make[2]: Leaving directory '/home/pi/nMirror/usbmuxd2/usbmuxd2' make[1]: [Makefile:430: all-recursive] Error 1 make[1]: Leaving directory '/home/pi/nMirror/usbmuxd2' make: *** [Makefile:362: all] Error 2

Any ideas what could be going on? `

bitxeno commented 1 year ago

your plist version not match, you can find a fixed version on PR

mothabrain commented 11 months ago

i accidentally deleted plist.h in /usr/local/include/plist/. how can i restore it?

sepsky commented 11 months ago

I passed a 0 after the last variable passed into plist_from_memory of Client.cpp, and it resolved the same issue I was having.

Not sure if this messes anything, because I'm having issues with uxbmuxd discovering devices (I have one on wifi)

mothabrain commented 11 months ago

https://github.com/tihmstar/usbmuxd2/pull/24/commits/e527bce2360afc22c95542f1252f94c994f45c72

did you edit both files like described above?

sepsky commented 11 months ago

I did it in both REPOROOT/usbmuxd2/Client.cpp and REPO_ROOT/usbmuxd2/sysconf/sysconf.cpp BTW, to be more accurate and provide more information, these are the options (I used 0, which corresponded to PLIST_FORMAT_NONE, but you can use whichever best for you, I think they don't make a difference?) :

    typedef enum
    {
        PLIST_FORMAT_NONE    = 0,  /**< No format */
        PLIST_FORMAT_XML     = 1,  /**< XML format */
        PLIST_FORMAT_BINARY  = 2,  /**< bplist00 format */
        PLIST_FORMAT_JSON    = 3,  /**< JSON format */
        PLIST_FORMAT_OSTEP   = 4,  /**< OpenStep "old-style" plist format */
        /* 5-9 are reserved for possible future use */
        PLIST_FORMAT_PRINT   = 10, /**< human-readable output-only format */
        PLIST_FORMAT_LIMD    = 11, /**< "libimobiledevice" output-only format (ideviceinfo) */
        PLIST_FORMAT_PLUTIL  = 12, /**< plutil-style output-only format */
    } plist_format_t;

To be more accurate, this is the better way of declaring the format:

plist_format_t format = PLIST_FORMAT_NONE;
plist_from_memory(pairRecord, record_len, &p_parsedPairRecord, &format);
tihmstar commented 6 months ago

Code has undergone a major rewrite since this issue was created.

Also, the code now does compile against the new libplist