Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

PsyCHo puNk

DLL exporting template classes

This topic is 6198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to export a template class from a standard WIN32 dll? I''ve tried it and I gather it can''t be done (either that or im not doing it right).

Share this post

Link to post
Share on other sites
I''m guessing you are using VC++ 6.0
( Because Borland C++ Builder 5.0 does it without a hitch )

VC++ is very picky about exported classes and templates, including member variables of classes that are exported.

Basically, VC++ allows you to export template instantiations. ( As does C++Builder )

But the must be EXPLICIT instantiations e.g.

template class __declspec(dllexport) std::vector;

To export a vector of longs.

Look it up on MSDN or online help - there''s info on exactly how to do it.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!