teakra icon indicating copy to clipboard operation
teakra copied to clipboard

Can't build dsptester

Open Midnoclose opened this issue 4 years ago • 6 comments

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

Midnoclose avatar Jan 08 '22 07:01 Midnoclose

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"

wwylele avatar Jan 08 '22 21:01 wwylele

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

Midnoclose avatar Jan 08 '22 23:01 Midnoclose

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

Midnoclose avatar Jan 11 '22 05:01 Midnoclose

  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 avatar Jan 11 '22 15:01 wwylele

Did the suggestion work for you?

wwylele avatar Jan 22 '22 19:01 wwylele

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

Midnoclose avatar Jan 23 '22 01:01 Midnoclose