Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    216025


2 Comments


Recommended Comments

I just tried to compile the code included with the documentation. Doesn't work.

(LINKY)

#include <boost/function.hpp>

#include <boost/bind.hpp>

class button
{
public:

boost::function<void> onClick;
};

class player
{
public:

void play();
void stop();
};

button playButton, stopButton;
player thePlayer;

void connect()
{
playButton.onClick = boost::bind(&player::play, &thePlayer);
stopButton.onClick = boost::bind(&player::stop, &thePlayer);
}

int main( int argc, char* argv[] ) {

return 0;
}




------ Build started: Project: vfs, Configuration: Debug Win32 ------

Compiling...
sandbox.cpp
c:\documents and settings\campbell\my documents\programs\pain\vfs\sandbox.cpp(8) : error C2079: 'button::onClick' uses undefined class 'boost::function<Signature>'
with
[
Signature=void
]
c:\documents and settings\campbell\my documents\programs\pain\vfs\sandbox.cpp(24) : error C2440: '=' : cannot convert from 'boost::_bi::bind_t<R,F,L>' to 'int'
with
[
R=void,
F=boost::_mfi::mf0<void,player>,
L=boost::_bi::list1<boost::_bi::value<player *__w64 >>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\documents and settings\campbell\my documents\programs\pain\vfs\sandbox.cpp(25) : error C2440: '=' : cannot convert from 'boost::_bi::bind_t<R,F,L>' to 'int'
with
[
R=void,
F=boost::_mfi::mf0<void,player>,
L=boost::_bi::list1<boost::_bi::value<player *__w64 >>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Build log was saved at "file://c:\Documents and Settings\Campbell\My Documents\Programs\pain\vfs\Debug\BuildLog.htm"
vfs - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





I am irate. But not an irate sombrero.



*breaks down in tears*

Share this comment


Link to comment

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