Hydr8gon / VitaControl

Use bluetooth controllers on your Vita!
68 stars 13 forks source link

Error trying to building it locally on 'mingw64 shell (Windows)': error: invalid conversion from 'uintptr_t' {aka 'unsigned int'} to 'const void*' [-fpermissive] #6

Closed mickael28 closed 2 years ago

mickael28 commented 2 years ago

Hi,

I was trying to build the project locally as well to see if I could progress the previous issue but after installing all required tools without error, when I run the make command it fails to build and throws the following errors, do you know why this could be and how we could fix it? Thanks.

$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/vitasdk/bin/arm-vita-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/vitasdk/bin/arm-vita-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /c/VITA_development_plugins/VitaControl/build

Then:

$ make
[ 10%] Building CXX object CMakeFiles/vitacontrol.dir/src/main.cpp.obj
In file included from c:\msys64\usr\local\vitasdk\arm-vita-eabi\include\psp2kern\kernel\sysmem.h:14,
                 from C:/VITA_development_plugins/VitaControl/src/mempool.h:4,
                 from C:/VITA_development_plugins/VitaControl/src/main.cpp:11:
C:/VITA_development_plugins/VitaControl/src/main.cpp: In function 'int sceCtrlGetBatteryInfoHookFunc(int, uint8_t*)':
C:/VITA_development_plugins/VitaControl/src/main.cpp:103:45: error: invalid conversion from 'uintptr_t' {aka 'unsigned int'} to 'const void*' [-fpermissive]
  103 |         ksceKernelMemcpyUserToKernel(&data, (uintptr_t)batt, sizeof(uint8_t));
      |                                             ^
      |                                             |
      |                                             uintptr_t {aka unsigned int}
c:\msys64\usr\local\vitasdk\arm-vita-eabi\include\psp2kern\kernel\sysmem\data_transfers.h:39:53: note:   initializing argument 2 of 'int ksceKernelMemcpyFromUser(void*, const void*, SceSize)'
   39 | int ksceKernelMemcpyFromUser(void *dst, const void *src, SceSize len);
      |                                         ~~~~~~~~~~~~^~~
C:/VITA_development_plugins/VitaControl/src/main.cpp:105:38: error: invalid conversion from 'uintptr_t' {aka 'unsigned int'} to 'void*' [-fpermissive]
  105 |         ksceKernelMemcpyKernelToUser((uintptr_t)batt, &data, sizeof(uint8_t));
      |                                      ^
      |                                      |
      |                                      uintptr_t {aka unsigned int}
c:\msys64\usr\local\vitasdk\arm-vita-eabi\include\psp2kern\kernel\sysmem\data_transfers.h:69:34: note:   initializing argument 1 of 'int ksceKernelMemcpyToUser(void*, const void*, SceSize)'
   69 | int ksceKernelMemcpyToUser(void *dst, const void *src, SceSize len);
      |                            ~~~~~~^~~
C:/VITA_development_plugins/VitaControl/src/main.cpp: In function 'int sceMotionGetStateHookFunc(SceMotionState*)':
C:/VITA_development_plugins/VitaControl/src/main.cpp:222:45: error: invalid conversion from 'uintptr_t' {aka 'unsigned int'} to 'const void*' [-fpermissive]
  222 |         ksceKernelMemcpyUserToKernel(&data, (uintptr_t)state, sizeof(SceMotionState));
      |                                             ^
      |                                             |
      |                                             uintptr_t {aka unsigned int}
c:\msys64\usr\local\vitasdk\arm-vita-eabi\include\psp2kern\kernel\sysmem\data_transfers.h:39:53: note:   initializing argument 2 of 'int ksceKernelMemcpyFromUser(void*, const void*, SceSize)'
   39 | int ksceKernelMemcpyFromUser(void *dst, const void *src, SceSize len);
      |                                         ~~~~~~~~~~~~^~~
C:/VITA_development_plugins/VitaControl/src/main.cpp:229:38: error: invalid conversion from 'uintptr_t' {aka 'unsigned int'} to 'void*' [-fpermissive]
  229 |         ksceKernelMemcpyKernelToUser((uintptr_t)state, &data, sizeof(SceMotionState));
      |                                      ^
      |                                      |
      |                                      uintptr_t {aka unsigned int}
c:\msys64\usr\local\vitasdk\arm-vita-eabi\include\psp2kern\kernel\sysmem\data_transfers.h:69:34: note:   initializing argument 1 of 'int ksceKernelMemcpyToUser(void*, const void*, SceSize)'
   69 | int ksceKernelMemcpyToUser(void *dst, const void *src, SceSize len);
      |                            ~~~~~~^~~
make[2]: *** [CMakeFiles/vitacontrol.dir/build.make:76: CMakeFiles/vitacontrol.dir/src/main.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/vitacontrol.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Hydr8gon commented 2 years ago

Looks like something changed in a newer version of Vita SDK. Simple fix, though.