Skip to main content
GameDev.net gamedev.net
🔒 Locked

boost::function not found??

Started by Gaiiden Oct 7, 2004 at 11:38 PM 2 replies 1.9k views
Original Post
Gaiiden
Gaiiden

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]
Drew Sikora
Executive Producer
GameDev.net
Houdini
Houdini
Perchance are you using a non-conforming compiler such as VC++ 6.0? If so, you need to use 'typedef boost::function1 Callback;' instead.


- Houdini
Houdini
darookie
darookie
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.
Gaiiden
Gaiiden
[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]
Drew Sikora
Executive Producer
GameDev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.