PS3Xploit / PS3xploit-resigner

A Tool To Resign PS2/PS3/PSX/PSP Content For Use With PS3 etHANol 4.82/4.84
GNU General Public License v3.0
186 stars 73 forks source link

Failed to compile main.cpp! MacOs #40

Open bruchhagevfx opened 4 years ago

bruchhagevfx commented 4 years ago

Hey, there I'm always getting this error running the resign_mac.sh. It's probably a noob mistake but I hope you can help me.

`s3xploit_resign: PS3Xploit ReSign BASH Script for act.dat, PKG, and RAP

ps3xploit_resign: Building 'ps3xploit_rifgen_edatresign'

Cleaning... clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] Successfully compiled aes.c. Successfully compiled aes_omac.cpp. main.cpp:685:5: error: use of undeclared identifier 'gettimeofday' gettimeofday(&te, NULL); // get current time ^ main.cpp:1004:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] while(read = fread(meta_buffer, 1, segment_size, in))


main.cpp:1004:13: note: place parentheses around the assignment to silence this
      warning
        while(read = fread(meta_buffer, 1, segment_size, in))
                   ^
              (                                             )
main.cpp:1004:13: note: use '==' to turn this assignment into an equality
      comparison
        while(read = fread(meta_buffer, 1, segment_size, in))
                   ^
                   ==
main.cpp:1319:37: warning: format specifies type 'unsigned int' but the argument
      has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("header[i].file_off=%x\n", header[i].file_off);
                                           ~~     ^~~~~~~~~~~~~~~~~~
                                           %llx
main.cpp:1320:38: warning: format specifies type 'unsigned int' but the argument
      has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("header[i].file_size=%x\n", header[i].file_size);
                                            ~~     ^~~~~~~~~~~~~~~~~~~
                                            %llx
main.cpp:1423:37: warning: format specifies type 'unsigned int' but the argument
      has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("header[i].file_off=%x\n", header[i].file_off);
                                           ~~     ^~~~~~~~~~~~~~~~~~
                                           %llx
main.cpp:1424:38: warning: format specifies type 'unsigned int' but the argument
      has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("header[i].file_size=%x\n", header[i].file_size);
                                            ~~     ^~~~~~~~~~~~~~~~~~~
                                            %llx
main.cpp:1390:6: warning: expression result unused [-Wunused-value]
        for(i;i<number_files;i++)
            ^
main.cpp:1577:7: warning: expression result unused [-Wunused-value]
                for(bkp;bkp<len;bkp+=100*1024*1024)
                    ^~~
main.cpp:1733:7: warning: expression result unused [-Wunused-value]
                for(sha1_loop;sha1_loop<len-0x20;sha1_loop+=100*1024*1024)
                    ^~~~~~~~~
8 warnings and 1 error generated.
Failed to compile main.cpp!
make: *** [main.o] Error 1

ps3xploit_resign: 'ps3xploit_rifgen_edatresign' not found, exiting...`
RobertoD91 commented 4 years ago

maybe adding #include <sys/time.h> in main.cpp will fix

https://stackoverflow.com/questions/24447322/cmake-failed-building-project-on-mac

RobertoD91 commented 4 years ago

and replace make; with make -f Makefile_macOS; in resign_mac.sh line 125