xerpi / ds4vita

Use a DS4 on your PSVita
177 stars 34 forks source link

Compile output problem #23

Closed masoudr closed 7 years ago

masoudr commented 7 years ago

Hi, I want to build your source for new version and extract the .skprx file from it. I tried to compile it with cmake . and the build process successfully finished, but I can't find the output file to put it in my vita. What I have to do next ? I'm using Windows 10 and PSDK3v3. Thanks.

xerpi commented 7 years ago

You have to first run cmake (mkdir build && cd build && cmake ..) to generate the Makefile and then 'make' to compile it. What does PSDK3v3 have to do with it? You need vitasdk (https://github.com/vitasdk/autobuilds/releases).

masoudr commented 7 years ago

As I said I'm using windows and the PSDK3v3 which is the Vita SDK tool for Windows version. I tried what you said and after using make it throw an error:

Masoud@DESKTOP-J7HT705 MINGW64 /c/Users/Masoud/Desktop/ds4vita/build
$ cmake ..
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /usr/local/vitasdk/bin/arm-vita-eabi-gcc.exe
-- Check for working C compiler: /usr/local/vitasdk/bin/arm-vita-eabi-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/vitasdk/bin/arm-vita-eabi-g++.exe
-- Check for working CXX compiler: /usr/local/vitasdk/bin/arm-vita-eabi-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /c/Users/Masoud/Desktop/ds4vita/build

Masoud@DESKTOP-J7HT705 MINGW64 /c/Users/Masoud/Desktop/ds4vita/build
$ ls
cmake_install.cmake  CMakeCache.txt  CMakeFiles  Makefile

Masoud@DESKTOP-J7HT705 MINGW64 /c/Users/Masoud/Desktop/ds4vita/build
$ make
Scanning dependencies of target ds4vita.elf
[ 33%] Building C object CMakeFiles/ds4vita.elf.dir/main.c.obj
C:/Users/Masoud/Desktop/ds4vita/main.c: In function 'mempool_alloc':
C:/Users/Masoud/Desktop/ds4vita/main.c:149:9: warning: implicit declaration of function 'ksceKernelAllocHeapMemory' [-Wimplicit-function-declaration]
  return ksceKernelAllocHeapMemory(bt_mempool_uid, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Masoud/Desktop/ds4vita/main.c:149:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
  return ksceKernelAllocHeapMemory(bt_mempool_uid, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Masoud/Desktop/ds4vita/main.c: In function 'mempool_free':
C:/Users/Masoud/Desktop/ds4vita/main.c:154:2: warning: implicit declaration of function 'ksceKernelFreeHeapMemory' [-Wimplicit-function-declaration]
  ksceKernelFreeHeapMemory(bt_mempool_uid, ptr);
  ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Masoud/Desktop/ds4vita/main.c: In function 'module_start':
C:/Users/Masoud/Desktop/ds4vita/main.c:745:2: error: unknown type name 'SceKernelHeapCreateOpt'
  SceKernelHeapCreateOpt opt;
  ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/Masoud/Desktop/ds4vita/main.c:746:5: error: request for member 'size' in something not a structure or union
  opt.size = 0x1C;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:747:5: error: request for member 'uselock' in something not a structure or union
  opt.uselock = 0x100;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:748:5: error: request for member 'field_8' in something not a structure or union
  opt.field_8 = 0x10000;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:749:5: error: request for member 'field_C' in something not a structure or union
  opt.field_C = 0;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:750:5: error: request for member 'field_10' in something not a structure or union
  opt.field_10 = 0;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:751:5: error: request for member 'field_14' in something not a structure or union
  opt.field_14 = 0;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:752:5: error: request for member 'field_18' in something not a structure or union
  opt.field_18 = 0;
     ^
C:/Users/Masoud/Desktop/ds4vita/main.c:754:19: warning: implicit declaration of function 'ksceKernelCreateHeap' [-Wimplicit-function-declaration]
  bt_mempool_uid = ksceKernelCreateHeap("ds4vita_mempool", 0x100, &opt);
                   ^~~~~~~~~~~~~~~~~~~~
C:/Users/Masoud/Desktop/ds4vita/main.c: In function 'module_stop':
C:/Users/Masoud/Desktop/ds4vita/main.c:781:3: warning: implicit declaration of function 'ksceKernelDeleteHeap' [-Wimplicit-function-declaration]
   ksceKernelDeleteHeap(bt_mempool_uid);
   ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ds4vita.elf.dir/build.make:63: CMakeFiles/ds4vita.elf.dir/main.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ds4vita.elf.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Is this error related to the version I am using? Actually, I'm not a Linux guy but how can I install the Vita SDK you mentioned? I would appreciate if you put a brief of installation method for this version on Ubuntu. Thanks.

xerpi commented 7 years ago

You are using an outdated version of VitaSDK. I didn't know about PSDK3v3 but I'd say uninstall it and install the latest official version (master-win-v369 as of now): https://github.com/vitasdk/autobuilds/releases

masoudr commented 7 years ago

I tried the new version but it throw an error about a missing dll file, then I installed the minigw-64 and it didn't even compile the code with cmake. I think I'm missing the VitaSDK dependencies. here is the error after using cmake":

C:\Users\Masoud\Desktop\ds4vita\build>cmake ..
-- Building for: NMake Makefiles
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: C:/vitasdk/vitasdk/bin/arm-vita-eabi-gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_87c24\fast"
-- Check for working C compiler: C:/vitasdk/vitasdk/bin/arm-vita-eabi-gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler "C:/vitasdk/vitasdk/bin/arm-vita-eabi-gcc.exe" is not able
  to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Users/Masoud/Desktop/ds4vita/build/CMakeFiles/CMakeTmp

  Run Build Command:"nmake" "/NOLOGO" "cmTC_87c24\fast"

  Generator: execution of make failed.  Make command was: "nmake" "/NOLOGO"
  "cmTC_87c24\fast"

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)

-- Configuring incomplete, errors occurred!
See also "C:/Users/Masoud/Desktop/ds4vita/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Masoud/Desktop/ds4vita/build/CMakeFiles/CMakeError.log".
xerpi commented 7 years ago

I don't know what's going on there, but it seems like it's using nmake and that's weird. I don't use Windows. Not sure if you followed all the steps: https://vitasdk.org/

masoudr commented 7 years ago

Thanks for the answer. I tried the all steps in vitasdk.org. I tried to update the sdk and compiled again and then I got a new error about missing taihen.h file, then I head to taihen repo and tried to build it and when I wanted to build it gave the following error (I know that I should post this on its GitHub repo):

 cmake ..
CMake Error at CMakeLists.txt:38 (add_subdirectory):
  The source directory

    /usr/local/taiHEN/taihen-parser

  does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred!
See also "/usr/local/taiHEN/CMakeFiles/CMakeOutput.log".

I'm trying to setup Ubuntu and test these procedures on that platform too.

xerpi commented 7 years ago

Try running git submodule update --init --recursive or use git clone --recursive.

masoudr commented 7 years ago

Thanks I finally compiled the taihen but how can I include it into the ds4vita ? still it gave me error about finding taihen.h ? which files of taihen build must be copied to which directory ? I tried to edit the main.c and include the taihen.h directory and then this error came up:

$ make
Scanning dependencies of target ds4vita.elf
[ 33%] Building C object CMakeFiles/ds4vita.elf.dir/main.c.obj
[ 66%] Linking C executable ds4vita.elf
c:/psdk3v3/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/6.2.0/../../../../arm-vita-eabi/bin/ld.exe: cannot find -ltaihenForKernel_stub
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ds4vita.elf.dir/build.make:121: ds4vita.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ds4vita.elf.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
xerpi commented 7 years ago

Did you make install taiHEN?

masoudr commented 7 years ago

You were right I missed it. Thanks I solved the problem now I have the output file. Thank you very much.

xerpi commented 7 years ago

Cool, glad to hear that.