0

This seems to be a common error, but most people online choose to just ignore the warning and move on. I do not wish to ignore the warning.

Basically, when using __declspec(dllexport) to convert a project to use dlls, the compiler has trouble dealing with templates and stl objects. An explanation of the problem, and suggested solution are listed here. I have implemented the giant #define statement suggested for maps, to no avail.

How do you make this work!? My code is absolutely littered with things like wchar_ts and std::maps, so hopefully a solution that doesn't involve writing something remotely complex for each class!

Chris
  • 21,549
  • 25
  • 71
  • 99
Mark
  • 6,123
  • 13
  • 41
  • 52

1 Answers1

1

Read this similar thread for a good discussion of the topic. I would suggest either of the following:

  1. Use a static library
  2. Hide all template-related types and interfaces behind non-template compiler firewall or pimpl.

After fighting with the linker changes from Visual C++ 6.0, to 2003, and then to 2005, I will never __declspec(dllexport) anything that has a template, bool, wchar_t, or time_t in the signature again. Actually, we just out-right stopped using DLLs altogether. Life is so much simpler now ;)

Community
  • 1
  • 1
D.Shawley
  • 58,213
  • 10
  • 98
  • 113