You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used Eclipse 2020 CDT on a Windows host, using the cross tool chain "gcc-arm-9.2-2019.12-mingw-w64-i686-arm-none-linux-gnueabihf" to compile for RaspberryPi as a target.
Set up a managed build project with above mentioned compiler set up as cross compiler.
This generally works for other projects.
So now I added the doctest folder to the project (by copy) and added it to the known include paths.
I made 2 source files: main.cpp, which contains nothing but #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN and including doctest.h, and, in subfolder "tests", a file Test01.cpp, which contains only the include to doctest, not the macro, as described in the tutorial.
I then added one testcase, which prints one std::cout line,
with one subcase, which does the same, while doing one REQUIRES on a constant, and one CHECK, checking one local static function call for a result.
I then built the project, generating a bunch of linker errors, e.g. for "multiple definition" of:
doctest::is_running_in_test';: in function doctest::detail::my_memcpy
doctest::detail::g_oss[abi:cxx11]'; in function __tls_init'
I searched the net and found some people with that problem.
It seems to be very dependent on the exact compiler tool chain being used, incl. specific target, and how the linking works exactly.
doctest version: v2.4.5
Operating System: Windows 10 (cross compile host), Linux for ARMv7, hardfloat (target)
Compiler+version: gcc-arm-9.2-2019.12-mingw-w64-i686-arm-none-linux-gnueabihf this toolchain
The text was updated successfully, but these errors were encountered:
Strange... I'm not sure how to help you with this. Make sure that you aren't compiling main.cpp more than once (or that you aren't linking the object file from it more than once) - perhaps you should inspect the verbose output of the build and see which object files are being compiled and what is being linked - with the full commands.
D'OH! I had just thrown that into a folder of some little test project with Eclipse managed build.
And forgot about this otherwise time-saving default behavior of Eclipse of adding everthing to the list of compiled things that it finds in the tree, unless you explicitly state e.g. a folder should be "exclude from build" ;)
Description
I used Eclipse 2020 CDT on a Windows host, using the cross tool chain "gcc-arm-9.2-2019.12-mingw-w64-i686-arm-none-linux-gnueabihf" to compile for RaspberryPi as a target.
Set up a managed build project with above mentioned compiler set up as cross compiler.
This generally works for other projects.
So now I added the doctest folder to the project (by copy) and added it to the known include paths.
I made 2 source files: main.cpp, which contains nothing but #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN and including doctest.h, and, in subfolder "tests", a file Test01.cpp, which contains only the include to doctest, not the macro, as described in the tutorial.
I then added one testcase, which prints one std::cout line,
with one subcase, which does the same, while doing one REQUIRES on a constant, and one CHECK, checking one local static function call for a result.
I then built the project, generating a bunch of linker errors, e.g. for "multiple definition" of:
doctest::is_running_in_test';: in function
doctest::detail::my_memcpydoctest::detail::g_oss[abi:cxx11]'; in function
__tls_init'... and a couple pages more of that
Steps to reproduce
main.cpp:
Test01.cpp:
Extra information
I searched the net and found some people with that problem.
It seems to be very dependent on the exact compiler tool chain being used, incl. specific target, and how the linking works exactly.
this toolchain
The text was updated successfully, but these errors were encountered: