foonathan/memory

make error

chenhaobin98 opened this issue · 5 comments

When I was compiling with make, the file under test/detial received an error excepted constrictor. destructor, or type conversion before '(' token

Please post the full error message and what compiler you're using.

请发布完整的错误消息以及您正在使用的编译器。

/home/chenhaobin/文档/PX4/memory/test/detail/align.cpp:12:10: error: expected constructor, destructor, or type conversion before ‘(’ token
12 | TEST_CASE("detail::align_offset", "[detail][core]")
| ^
/home/chenhaobin/文档/PX4/memory/test/detail/align.cpp:30:10: error: expected constructor, destructor, or type conversion before ‘(’ token
30 | TEST_CASE("detail::is_aligned", "[detail][core]")
| ^
/home/chenhaobin/文档/PX4/memory/test/detail/align.cpp:53:10: error: expected constructor, destructor, or type conversion before ‘(’ token
53 | TEST_CASE("detail::alignment_for", "[detail][core]")
| ^
make[2]: *** [test/CMakeFiles/foonathan_memory_test.dir/build.make:76:test/CMakeFiles/foonathan_memory_test.dir/detail/align.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:329:test/CMakeFiles/foonathan_memory_test.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Ah, it's an old issue with the build system that I should really fix. To workaround, download https://raw.githubusercontent.com/catchorg/Catch2/2e61d38c7c3078e600c331257b5bebfb81aaa685/single_include/catch2/catch.hpp and place it in /test/catch.hpp

嗯,这是构建系统的一个老问题,我应该真正解决。要解决此问题,请下载https://raw.githubusercontent.com/catchorg/Catch2/2e61d38c7c3078e600c331257b5bebfb81aaa685/single_include/catch2/catch.hpp并将其放在/test/catch.hpp中

thank you

This error shouldn't happen anymore.