ybainier / Hypodermic

Hypodermic is an IoC container for C++. It provides dependency injection to your existing design.
MIT License
574 stars 81 forks source link

GUN C++ 4.7.3 Compiler error #35

Closed NeilHuangHi closed 5 years ago

NeilHuangHi commented 5 years ago

Hi ybainier,

I encounter the compiler error as below message:

BuildFiles/GNU_ARM_DEBUG/makefile.mk:394: Main.o' failed In file included from usr/include/Hypodermic/ComponentContext.h:12:0, from usr/include/Hypodermic/Container.h:6, from usr/include/Hypodermic/ContainerBuilder.h:8, from usr/include/Hypodermic/Hypodermic.h:3, from Src/Main.cpp:13: usr/include/Hypodermic/IRegistrationScope.h:19:17: error: looser throw specifier for 'virtual Hypodermic::IRegistrationScope::~IRegistrationScope()' In file included from usr/include/Hypodermic/IRegistrationScope.h:5:0, from usr/include/Hypodermic/ComponentContext.h:12, from usr/include/Hypodermic/Container.h:6, from usr/include/Hypodermic/ContainerBuilder.h:8, from usr/include/Hypodermic/Hypodermic.h:3, from Src/Main.cpp:13: usr/include/Hypodermic/IRegistrationRegistry.h:15:17: error: overriding 'virtual Hypodermic::IRegistrationRegistry::~IRegistrationRegistry() noexcept (true)' In file included from usr/include/Hypodermic/Registration.h:10:0, from usr/include/Hypodermic/RegistrationBuilder.h:10, from usr/include/Hypodermic/AutowireableConstructorRegistrationDescriptor.h:10, from usr/include/Hypodermic/RegistrationDescriptorBuilder.h:6, from usr/include/Hypodermic/ContainerBuilder.h:12, from usr/include/Hypodermic/Hypodermic.h:3, from Src/Main.cpp:13: usr/include/Hypodermic/RegistrationActivator.h:20:11: error: looser throw specifier for 'virtual Hypodermic::RegistrationActivator::~RegistrationActivator()' In file included from usr/include/Hypodermic/ResolutionContainer.h:16:0, from usr/include/Hypodermic/RegistrationScope.h:11, from usr/include/Hypodermic/NestedRegistrationScope.h:8, from usr/include/Hypodermic/ComponentContext.h:16, from usr/include/Hypodermic/Container.h:6, from usr/include/Hypodermic/ContainerBuilder.h:8, from usr/include/Hypodermic/Hypodermic.h:3, from Src/Main.cpp:13: usr/include/Hypodermic/IRegistrationActivator.h:16:17: error: overriding 'virtual Hypodermic::IRegistrationActivator::~IRegistrationActivator() noexcept (true)' In file included from usr/include/Hypodermic/RegistrationBuilder.h:10:0, from usr/include/Hypodermic/AutowireableConstructorRegistrationDescriptor.h:10, from usr/include/Hypodermic/RegistrationDescriptorBuilder.h:6, from usr/include/Hypodermic/ContainerBuilder.h:12, from usr/include/Hypodermic/Hypodermic.h:3, from Src/Main.cpp:13: usr/include/Hypodermic/Registration.h:20:11: error: looser throw specifier for 'virtual Hypodermic::Registration::~Registration()' In file included from usr/include/Hypodermic/ComponentContext.h:11:0, from usr/include/Hypodermic/Container.h:6, from usr/include/Hypodermic/ContainerBuilder.h:8, from usr/include/Hypodermic/Hypodermic.h:3, from Src/Main.cpp:13: usr/include/Hypodermic/IRegistration.h:19:17: error: overriding 'virtual Hypodermic::IRegistration::~IRegistration() noexcept (true)' make: *** [Obj/GNU_ARM_DEBUG/Main.o] Error 1 make: Target 'build' not remade because of errors.

My main content :

include <Hypodermic/Hypodermic.h>

int main() { rerurn 0; }

I only want to build successfully.

Whether this c++ version doesn't support c++ 4.7.3 ?

Please help.

Thank you very much.

Neil

NeilHuangHi commented 5 years ago

Hi, I follow https://stackoverflow.com/questions/22698653/looser-throw-specifier-in-c in deconstructor add throw(). Solve it.