0

I have the following template class Invokable<ReturnType, Arguments...> that serves as a base class for Call that's meant to implement a type of Invokable<ReturnType, Arguments...> where ReturnType == std::string and Arguments == std::unordered_map<std::string, std::string>.

template<typename ReturnType, typename... Arguments>
class Invokable
{

public:
  typedef std::function<ReturnType(Arguments... arguments)> Function;

  Invokable(Function& function);
  Invokable();
  ~Invokable();
  ReturnType invokeFunction(const Arguments... arguments) const;
  void bindFunction(Function& functionToBind);
  ReturnType operator()(const Arguments... arguments) const;
};

Is there anything wrong with this specific definition that would cause the following output?:

CMakeFiles/wintermutecore.dir/call.cpp.o: In function `Wintermute::Call::Call(std::string const&)':
/home/jalcine/Development/Projects/Wintermute/core/src/wintermutecore/call.cpp:(.text+0x29): undefined reference to `Wintermute::Util::Invokable<std::string const, std::string const&>::Invokable()'
/home/jalcine/Development/Projects/Wintermute/core/src/wintermutecore/call.cpp:(.text+0x121): undefined reference to `Wintermute::Util::Invokable<std::string const, std::string const&>::~Invokable()'
CMakeFiles/wintermutecore.dir/call.cpp.o: In function `Wintermute::Call::~Call()':
/home/jalcine/Development/Projects/Wintermute/core/src/wintermutecore/call.cpp:(.text+0x18b): undefined reference to `Wintermute::Util::Invokable<std::string const, std::string const&>::~Invokable()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libwintermutecore.so] Error 1
make[1]: *** [src/wintermutecore/CMakeFiles/wintermutecore.dir/all] Error 2
make: *** [all] Error 2

The source code for full examining is available at https://github.com/jalcine/wintermute/commit/117c493dfd227cee7bad6361fd1ddc0287e1ac59.

jackyalcine
  • 469
  • 1
  • 8
  • 21

1 Answers1

0

Okay, after doing some more homework, I finally found this https://stackoverflow.com/a/8752870/602588 and https://stackoverflow.com/a/8752879/602588. I took the latter approach.

Community
  • 1
  • 1
jackyalcine
  • 469
  • 1
  • 8
  • 21