2014-09-25 1 views
0

내가 이해하지 못하는 컴파일 타임 오류 목록이 나타납니다. 나는 sourceforge, 버전 0.9.1에서 luabind 라이브러리를 사용하고 있으며, MyGUI에서 함수를 바인드하려고하는데 Visual Studio 2012와 Lua 5.1을 사용하고 있습니다. 오류는 다른 파일에서 비롯된 것 같지만 아래의 cpp 코드를 컴파일하는 동안 발생합니다. 오류로 인해 내 IntelliSense에서 이러한 문제를 나타내지는 않지만 서명을 올바르게 정의하지 않았다고 생각합니다.Luabind 컴파일 시간 오류 템플릿 인수를 추론 할 수 없습니다.

문제의 코드 :

Error 4 error C2780: 'void luabind::detail::value_wrapper_converter<U>::apply(lua_State *,const T &)' : expects 2 arguments - 3 provided c:\users\jake kiesel\space-junk\c++ project\3rdpartycode\include\luabind\detail\call.hpp 293 1 Space Junk 
Error 3 error C2784: 'int luabind::detail::value_wrapper_converter<U>::match(lua_State *,luabind::detail::by_const_reference<T>,int)' : could not deduce template argument for 'luabind::detail::by_const_reference<T>' from 'luabind::detail::by_reference<T>' c:\users\jake kiesel\space-junk\c++ project\3rdpartycode\include\boost\preprocessor\iteration\detail\local.hpp 34 1 Space Junk 
Error 2 error C2784: 'int luabind::detail::value_wrapper_converter<U>::match(lua_State *,luabind::detail::by_value<T>,int)' : could not deduce template argument for 'luabind::detail::by_value<T>' from 'luabind::detail::by_reference<T>' c:\users\jake kiesel\space-junk\c++ project\3rdpartycode\include\boost\preprocessor\iteration\detail\local.hpp 34 1 Space Junk 
Error 6 error C2784: 'T luabind::detail::value_wrapper_converter<U>::apply(lua_State *,luabind::detail::by_const_reference<T>,int)' : could not deduce template argument for 'luabind::detail::by_const_reference<T>' from 'luabind::detail::by_reference<T>' c:\users\jake kiesel\space-junk\c++ project\3rdpartycode\include\luabind\detail\call.hpp 293 1 Space Junk 
Error 5 error C2784: 'T luabind::detail::value_wrapper_converter<U>::apply(lua_State *,luabind::detail::by_value<T>,int)' : could not deduce template argument for 'luabind::detail::by_value<T>' from 'luabind::detail::by_reference<T>' c:\users\jake kiesel\space-junk\c++ project\3rdpartycode\include\luabind\detail\call.hpp 293 1 Space Junk 

편집 :

을 통해 (유래는 몸 길이에 대해 불평, 그래서 페이스트 빈에 넣어) 주어진

오류

LuaMachine.cpp

추가 연구 나는 다음과 같은 오류가 이러한 문제를 일으키는 줄을 발견했습니다. 이 줄은 wrapGuiManager 함수에 있습니다.

luabind :: 데프 ("destroyWidgets", & MyGUIManager :: destroyWidgets)

luabind :: 데프 ("unloadLayout", & MyGUIManager :: unloadLayout),

이 이들에 대한 함수 선언이다 함수 :

void unloadLayout (luabind :: object & table);

void destroyWidgets (luabind :: object & table);

이 두 함수는 모두 luabind :: object & 매개 변수를 사용한다는 점에서 고유합니다. 그들은 MyGUI 위젯으로 가득 찬 배열로 사용되는 루아에서 테이블을 가져갈 수 있어야합니다.

+1

이것을 피하는 것이 좋지만이 시점에서 유일한 해결책 인 것 같습니다. – megadan

+0

정말 좋겠이 오히려 큰 파일을 어떻게 지루한 될 것이라고 감안할 때 찾을 때까지 한 번에 수출 클래스와 함수 하나를 시도 할 것 –

+0

그 방법을 사용하여 문제를 wrapGuiManager 함수로 분리 할 수있었습니다. 이 기능을 계속 조사 할 것입니다. –

답변

2

나는 그것을 작동시켰다! : D 문제 라인

luabind::def("destroyWidgets", &MyGUIManager::destroyWidgets) 

luabind::def("unloadLayout", &MyGUIManager::unloadLayout) 

그 기능을 모두 luabind::object&했다, luabind하지만 그와 협력하고 싶지 않았어했다, 대신 참조없이 luabind::object을하는 기능을 원했다 , 그리고 단지 객체 자체. 그래서 올바른 함수 선언은 다음과 같습니다

void unloadLayout(luabind::object table); 
void destroyWidgets(luabind::object table); 
당신이 오류의 원인이되는
관련 문제