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 had the following issue when trying to compile the static_exception library:
CMake Warning at /usr/src/gtest/CMakeLists.txt:54 (project):
VERSION keyword not followed by a value or was followed by a value that
expanded to nothing.
static_exception/test/static_exception_test.cpp:37:20: warning: inline function ‘void exception_memory::__cxx::cxa_free_exception(void*)’ used but never defined
37 | extern inline void cxa_free_exception(void vptr) noexcept;
| ^~~~~~~~~~~~~~~~~~
static_exception/test/static_exception_test.cpp:36:20: warning: inline function ‘void exception_memory::__cxx::cxa_free_dependent_exception(void)’ used but never defined
36 | extern inline void cxa_free_dependent_exception (void vptr) noexcept;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: CMakeFiles/static_exception_test.dir/static_exception_test.cpp.o: in function StaticExceptions_MemoryLeak_Test::TestBody()': static_exception/test/static_exception_test.cpp:193: undefined reference to exception_memory::__cxx::cxa_free_exception(void)'
/usr/bin/ld: static_exception/test/static_exception_test.cpp:194: undefined reference to `exception_memory::__cxx::cxa_free_dependent_exception(void*)'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/static_exception_test.dir/build.make:90: test/static_exception_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:153: test/CMakeFiles/static_exception_test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I used colcon build to build it.
gcc/g++ version are: 9.4.0.
Do you have any idea on how to solve this?
Thank you!
The text was updated successfully, but these errors were encountered:
@EleonoreJ good catch! Looks like there was a missing #include <cstdlib> in there somehow. I've opened up #3 with the fix as well as added some CI to check for these types of errors in the future. Feel free to use the CI script as a template on how to build and run the repo.
@flynneva Thank you for answering!
I am able to run cmake .. and make and then the tests.
But, when I try to do colcon build, I still have the same issue, am I missing something?
And quick question: is it compliant with hard real-time requirements?
Do you know if it violates some Autosar's rules?
Many thanks!
But, when I try to do colcon build, I still have the same issue, am I missing something?
@EleonoreJ with colcon, sometimes it is necessary to "clean" your workspace (e.g. remove the build, install and log directories completely). I'd suggest trying that and rebuilding.
is it compliant with hard real-time requirements?
@EleonoreJ I wont answer this question directly since the purpose of this repository is to demonstrates a simple way to avoid dynamic memory allocations from exceptions. So I guess my answer is: potentially? 😅
Do you know if it violates some Autosar's rules?
@EleonoreJ again, this is beyond the scope of this repo - so the answer again is "potentially". Our good friends at Axivion might be able to help you though.
I had the following issue when trying to compile the static_exception library:
CMake Warning at /usr/src/gtest/CMakeLists.txt:54 (project):
VERSION keyword not followed by a value or was followed by a value that
expanded to nothing.
static_exception/test/static_exception_test.cpp:37:20: warning: inline function ‘void exception_memory::__cxx::cxa_free_exception(void*)’ used but never defined
37 | extern inline void cxa_free_exception(void vptr) noexcept;
| ^~~~~~~~~~~~~~~~~~
static_exception/test/static_exception_test.cpp:36:20: warning: inline function ‘void exception_memory::__cxx::cxa_free_dependent_exception(void)’ used but never defined
36 | extern inline void cxa_free_dependent_exception (void vptr) noexcept;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: CMakeFiles/static_exception_test.dir/static_exception_test.cpp.o: in function
StaticExceptions_MemoryLeak_Test::TestBody()': static_exception/test/static_exception_test.cpp:193: undefined reference to
exception_memory::__cxx::cxa_free_exception(void)'/usr/bin/ld: static_exception/test/static_exception_test.cpp:194: undefined reference to `exception_memory::__cxx::cxa_free_dependent_exception(void*)'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/static_exception_test.dir/build.make:90: test/static_exception_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:153: test/CMakeFiles/static_exception_test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I used colcon build to build it.
gcc/g++ version are: 9.4.0.
Do you have any idea on how to solve this?
Thank you!
The text was updated successfully, but these errors were encountered: