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

## 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 on other sites
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 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 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]

1. 1
2. 2
3. 3
frob
14
4. 4
5. 5

• 10
• 13
• 14
• 68
• 14
• ### Forum Statistics

• Total Topics
632134
• Total Posts
3004304

×