Jump to content
  • Advertisement
Sign in to follow this  
Gaiiden

boost::function not found??

This topic is 5155 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

typedef boost::function<void(DataPtr)> Callback;
error C2039: 'function' : is not a member of 'boost' Ugh. I included "boost/function.hpp", I don't have the namespace defined but I'm doing boost::function<>, I made sure the boost folder was set in my include directories list, I tried a full rebuild... Anyone have any idea what I may be missing here? The example I saw listed only "boost/function.hpp" as being needed, so I don't know why I'm getting this error. It can't be a missing .lib can it? Since I haven't even reached the linking stage thanks to this error (and a few other related ones). [help]

Share this post


Link to post
Share on other sites
Advertisement
Perchance are you using a non-conforming compiler such as VC++ 6.0? If so, you need to use 'typedef boost::function1<void, DataPtr> Callback;' instead.


- Houdini

Share this post


Link to post
Share on other sites
I guess this a compiler-specific issue. Older versions of the VC++
compiler (VC++ 6 for sure, maybe even VC++ 2002) don't have full support for C++ templates. You will have to use boost::function_1 or something like that depending on the number of actual arguments passed to it.

VC++ 2003 and later don't have this problem. I don't know for any other compiler (like older versions of GCC), but with VC++ lack of template support is the main reason for this issue.

Check out the boost docs, IIRC this is mentioned somewhere.

Hope this helps,
Pat.

Share this post


Link to post
Share on other sites
[oh]

When I was reading the docs I assumed the portable syntax to mean platforms, not compilers. D'oh! Obviously I was skimming and didn't pay it much heed, because in retrospect that's a kinda dumb assumption. But I see now that they list VC++ 6 under the portable syntax table at the top.

I knew it was something stupid. Ah well. Rating++ to you guys [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!