Jump to content
  • Advertisement
Sign in to follow this  
simonloach

Wierd compiler errors

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

I'm writing input handling into my game using a callback function that is called when the input is updated.
Application::Start(InputManager* inputmanager)
{
	// ...

	boost::function<void (const Controller& c)> fn;

	fn = boost::bind(&Application::InputCallback, this);

	inputmanager->RegisterCallback(fn);
}

void Application::InputCallback(const Controller& c)
{
	// ...
}

Compiler output:
1>------ Build started: Project: shadow_mapping, Configuration: Debug Win32 ------
1>Compiling...
1>Application.cpp
1>d:\project\lib\boost_1_35_0\boost\bind.hpp(1613) : warning C4180: qualifier applied to function type has no meaning; ignored
1>        d:\project\lib\boost_1_35_0\boost\bind.hpp(1647) : see reference to class template instantiation 'boost::_bi::add_cref<Pm,I>' being compiled
1>        with
1>        [
1>            Pm=void (__thiscall Application::* )(const Controller &),
1>            I=1
1>        ]
1>        d:\project\shadow_mapping\application.cpp(102) : see reference to class template instantiation 'boost::_bi::dm_result<Pm,A1>' being compiled
1>        with
1>        [
1>            Pm=void (__thiscall Application::* )(const Controller &),
1>            A1=Application *
1>        ]
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(318) : warning C4180: qualifier applied to function type has no meaning; ignored
1>        d:\project\lib\boost_1_35_0\boost\bind\bind_template.hpp(344) : see reference to class template instantiation 'boost::_mfi::dm<R,T>' being compiled
1>        with
1>        [
1>            R=void (const Controller &),
1>            T=Application
1>        ]
1>        d:\project\shadow_mapping\application.cpp(102) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>        with
1>        [
1>            R=void (\
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(326) : warning C4180: qualifier applied to function type has no meaning; ignored
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(331) : warning C4180: qualifier applied to function type has no meaning; ignored
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(345) : warning C4180: qualifier applied to function type has no meaning; ignored
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(350) : warning C4180: qualifier applied to function type has no meaning; ignored
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(362) : warning C4180: qualifier applied to function type has no meaning; ignored
1>d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(342) : fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1411)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++ 
1> Help menu, or open the Technical Support help file for more information
1>        d:\project\lib\boost_1_35_0\boost\mem_fn.hpp(341) : while compiling class template member function 'void (\
1>        d:\project\lib\boost_1_35_0\boost\bind\bind_template.hpp(344) : see reference to class template instantiation 'boost::_mfi::dm<R,T>' being compiled
1>        with
1>        [
1>            R=void (const Controller &),
1>            T=Application
1>        ]
1>        d:\project\shadow_mapping\application.cpp(102) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>        with
1>        [
1>            R=void (\
1>Build log was saved at "file://d:\project\shadow_mapping\Debug\BuildLog.htm"
1>shadow_mapping - 1 error(s), 7 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Share this post


Link to post
Share on other sites
Advertisement
You're missing the argument placeholder in your bind expression.

fn = boost::bind(&Application::InputCallback, this, _1);

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!