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
190 stars 41 forks source link

too few arguments to function upon make of file #28

Closed teddiebean closed 10 months ago

teddiebean commented 1 year ago

Getting this error on two separate systems and instances when trying to make the file, always comes up with the same error information, see below - always combination of error 1 and error 2

~/usbmuxd2 $ make make all-recursive make[1]: Entering directory '/home/pi/usbmuxd2' Making all in usbmuxd2 make[2]: Entering directory '/home/pi/usbmuxd2/usbmuxd2' g++ -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 -g -O0 -DDEBUG=1 -MT usbmuxd-Client.o -MD -MP -MF .deps/usbmuxd-Client.Tpo -c -o usbmuxd-Client.otest -f 'Client.cpp' || echo './'Client.cpp Client.cpp: In member function ‘void Client::processData(const usbmuxd_header*)’: Client.cpp:292:96: error: too few arguments to function ‘plist_err_t plist_from_memory(const char*, uint32_t, void**, plist_format_t*)’ 292 | plist_from_memory(pairRecord, (uint32_t)pairRecord_len, &p_parsedPairRecord); | ^ In file included from Client.hpp:15, from Client.cpp:8: /usr/local/include/plist/plist.h:846:27: note: declared here 846 | PLIST_API plist_err_t plist_from_memory(const char *plist_data, uint32_t length, plist_t *plist, plist_format_t *format); | ^~~~~~~~~~~~~~~~~ make[2]: *** [Makefile:633: usbmuxd-Client.o] Error 1 make[2]: Leaving directory '/home/pi/usbmuxd2/usbmuxd2' make[1]: *** [Makefile:432: all-recursive] Error 1 make[1]: Leaving directory '/home/pi/usbmuxd2' make: *** [Makefile:364: all] Error 2

sepsky commented 1 year ago

I edited the Client.cpp and sysconf.cpp‎ so that I pass the following in:

plist_format_t format = PLIST_FORMAT_NONE;
plist_from_memory(pairRecord, record_len, &p_parsedPairRecord, &format);

The error is due to a breaking change. the plist_from_memory now also needs a format parameter passed in. (have a look at plist_format_t, I passed PLIST_FORMAT_NONE but you can pass PLIST_FORMAT_JSONand PLIST_FORMAT_XML as well, but check the values of the enum in case)

teddiebean commented 1 year ago

How do I check the values to ensure the correct type is passed in?

Which files do I need to make the changes in?

sepsky commented 1 year ago

you need to make the changes in the files you have errors. From the logs you posted above, the issue is in Client.pp, inside the usbmuxd2 folder within the root usbmuxd2 folder (the root is the folder git creates when you clone). So for example, if you've cloned the repo in ~/Documents, it'll be ~/Documents/usbmuxd2/usbmuxd2/Client.cpp.

If you do a search of your repo for that plist_from_memory, you should be finding 2 instances of its execution. Those are the places I found.

These are the values (they're inside libelist):

    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;

In terms of validity of these, and which one you should use, I don't know. I am also having issues with usbmuxd2 (not the installation, at least I think my installation is ok with the PLIST_FORMAT_NONE as I have also tried PLIST_FORMAT_JSON, but I'm still having issues with using the tool).

tihmstar commented 10 months ago

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