Sign in to follow this  

boost::function not found??

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

This topic is 4813 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this