0

I'm linking against a library with the following class definition (some extraneous members/functions omitted):

class metric_family {
public:
    class builder {
        public:
            builder(std::string name, std::string help);
    }

    metric_family(const builder &builder);
};

Which on windows returns an LNK2001: unresolved external symbol "public: __cdecl metric_family::builder::builder(" for the string, string ctor (omitting all the template error for string messages). Every other symbol from this library works fine and I can create any other type from there except for a builder. What else more do I need to do to export the builder class? A forward declaration doesn't seem to have worked, and this works fine on linux

Madden
  • 1,024
  • 1
  • 9
  • 27
  • 2
    Your example code is incomplete. Please reduce your original program to the shortest **complete** program that demonstrates the error. See [mcve] for more information. – Robᵩ Apr 25 '18 at 16:58
  • this is an external library? Look at its exports with objdump. If its your code then are you sure you have an implementation of that constructor? – pm100 Apr 25 '18 at 16:59
  • This is an external library and the constructor is implemented – Madden Apr 25 '18 at 17:00
  • 1
    This is very far from a minimal example or anything that we can directly help with. – drescherjm Apr 25 '18 at 17:05
  • How did you create the library. Is it a static library? – drescherjm Apr 25 '18 at 17:06

0 Answers0