wwylele / teakra

DSi/3DS DSP emulator, disassembler, assembler, and tester
MIT License
76 stars 19 forks source link

Can't build dsptester #50

Open Midnoclose opened 2 years ago

Midnoclose commented 2 years ago

I get this output:

cdc.bin
main.cpp
/home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp:14:10: fatal error: ../../src/test.h: No such file or directory
   14 | #include "../../src/test.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/opt/devkitpro/devkitARM/base_rules:80: main.o] Error 1
make: *** [Makefile:101: build] Error 2
wwylele commented 2 years ago

This include is meant to refer to this file: https://github.com/wwylele/teakra/blob/master/src/test.h (a shared header between the main project and the 3DS program)

Is your current directory /home/midnoclose/Development/teakra/hwtest/dsptester/ ? I would expect it to work. If it doesn't, you can copy the file to the source directory and change that line to #include "test.h"

Midnoclose commented 2 years ago

That is my current directory, I'll try to copy the file when i get the chance.

Midnoclose commented 2 years ago

Output:

cdc.bin
main.cpp
In file included from /home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp:14:
/home/midnoclose/Development/teakra/hwtest/dsptester/source/test.h:30:20: error: 'is_trivially_copyable_v' is not a member of 'std'; did you mean 'is_trivially_copyable'?
   30 | static_assert(std::is_trivially_copyable_v<State>);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~
      |                    is_trivially_copyable
/home/midnoclose/Development/teakra/hwtest/dsptester/source/test.h:30:49: error: expected primary-expression before '>' token
   30 | static_assert(std::is_trivially_copyable_v<State>);
      |                                                 ^
/home/midnoclose/Development/teakra/hwtest/dsptester/source/test.h:30:50: error: expected primary-expression before ')' token
   30 | static_assert(std::is_trivially_copyable_v<State>);
      |                                                  ^
/home/midnoclose/Development/teakra/hwtest/dsptester/source/test.h:38:20: error: 'is_trivially_copyable_v' is not a member of 'std'; did you mean 'is_trivially_copyable'?
   38 | static_assert(std::is_trivially_copyable_v<TestCase>);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~
      |                    is_trivially_copyable
/home/midnoclose/Development/teakra/hwtest/dsptester/source/test.h:38:52: error: expected primary-expression before '>' token
   38 | static_assert(std::is_trivially_copyable_v<TestCase>);
      |                                                    ^
/home/midnoclose/Development/teakra/hwtest/dsptester/source/test.h:38:53: error: expected primary-expression before ')' token
   38 | static_assert(std::is_trivially_copyable_v<TestCase>);
      |                                                     ^
/home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp: In function 'void FlushCache(void*, u32)':
/home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp:172:50: error: invalid conversion from 'void*' to 'u32' {aka 'long unsigned int'} [-fpermissive]
  172 |     svcFlushProcessDataCache(CUR_PROCESS_HANDLE, ptr, size);
      |                                                  ^~~
      |                                                  |
      |                                                  void*
In file included from /opt/devkitpro/libctru/include/3ds.h:15,
                 from /home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp:4:
/opt/devkitpro/libctru/include/3ds/svc.h:1231:53: note:   initializing argument 2 of 'Result svcFlushProcessDataCache(Handle, u32, u32)'
 1231 | Result svcFlushProcessDataCache(Handle process, u32 addr, u32 size);
      |                                                 ~~~~^~~~
/home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp: In function 'void InvalidateCache(void*, u32)':
/home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp:176:55: error: invalid conversion from 'void*' to 'u32' {aka 'long unsigned int'} [-fpermissive]
  176 |     svcInvalidateProcessDataCache(CUR_PROCESS_HANDLE, ptr, size);
      |                                                       ^~~
      |                                                       |
      |                                                       void*
In file included from /opt/devkitpro/libctru/include/3ds.h:15,
                 from /home/midnoclose/Development/teakra/hwtest/dsptester/source/main.cpp:4:
/opt/devkitpro/libctru/include/3ds/svc.h:1215:58: note:   initializing argument 2 of 'Result svcInvalidateProcessDataCache(Handle, u32, u32)'
 1215 | Result svcInvalidateProcessDataCache(Handle process, u32 addr, u32 size);
      |                                                      ~~~~^~~~
make[1]: *** [/opt/devkitpro/devkitARM/base_rules:80: main.o] Error 1
make: *** [Makefile:101: build] Error 2
wwylele commented 2 years ago
  1. Change the flag here to c++17
  2. add (u32)addr to all places where it reports invalid conversion from 'void*' to 'u32'. There was a incompatible libctru update.
wwylele commented 2 years ago

Did the suggestion work for you?

Midnoclose commented 2 years ago

Changing #include "../../src/test.h" to #include "../../../src/test.h" and adding (u32)addr to where it needed to be worked and I was able to compile the software