저는 C++ 전문가가 아니기 때문에이 오류를 다양한 시도에서 반복하려고했습니다. 사실 내가 할 wanto로 2 3 클래스와 작은 프로그램을 할 때, 아무런 오류가 없다는 것입니다. 하지만 주요 applicaiton에서 나는 심지어 (말도 안되는) 솔루션을 많이 시도해도 오류가 지속 쓰려고 해요.생성자에서 포인터 (* &)를 전달할 때 이상한 오류가 발생했습니다.
문제는 내가 자원으로 생성자를 취하는 다른 구체적인 동작을 나타내는 전략 패턴과 일부 리소스를 포인터로 인스턴스화하는 주 클래스가 있다는 것입니다. 주요 응용 프로그램에서
,() 초기화하기 :
device = new Kinect();
controls = new Gui();
UserPositionBehaviour = new UserPositionBehaviour(device, controls);
하고, 행동 생성자 :
UserPositionBehaviour(Kinect * device, Gui * controls);
이 오류입니다 :
src/App.cpp:30: error: no matching function for call to ‘UserPositionBehaviour::UserPositionBehaviour(Kinect*&, ofTrueTypeFont*&, ofxGui*&)’
src/UserPositionBehaviour.h:15: note: candidates are: UserPositionBehaviour::UserPositionBehaviour(Kinect*, ofxGui*, ofTrueTypeFont*)
src/UserPositionBehaviour.h:13: note: UserPositionBehaviour::UserPositionBehaviour(const UserPositionBehaviour&)
어은? 헤이, 무슨 일 이니? 내가 포인터를 전달 해요, 아니 * & (그게 내가 어떻게 이벤트를 읽을 줄 몰라)
어떤 조언?
당신이 진정으로 생성자가있는 경우
우리에게 표시되는 코드는 두 개의 인수로 구성된 생성자를 보여줍니다. 오류 메시지에는 3 개의 인수와 1 개의 인수가 있다고합니다. 여기 뭔가가 잘못되어 있습니다. 실제 코드를 보여줄 수 있습니까? –
두 개의 인수를 허용하는 생성자가 나타나지 않습니다. – hmjd
기대하고있는 것과 다른 버전의'UserPositionBehaviour'를 포함하는 헤더를 포함하고있을 가능성이 있습니까? – molbdnilo