NULL을 재정의하는 라이브러리를 사용하고 있습니다. 내 프로그램의 다른 부분에 문제가 발생합니다. 내가 뭘 할 수 있는지 잘 모르겠다. 어떤 생각? 내 프로그램은 C++이고, 라이브러리는 C입니다.라이브러리가 NULL을 다시 정의합니다.
#ifdef NULL
#undef NULL
#endif
/**
* NULL define.
*/
#define NULL ((void *) 0)
아, 그리고이 이러한 오류 발생 :
이Generic.h:67: error: default argument for parameter of type 'LCD::LCDBase*' has type 'void*'
Generic.cpp: In constructor 'LCD::Generic::Generic(std::string, Json::Value*, int, LCD::LCDBase*)':
Generic.cpp:44: error: invalid conversion from 'void*' to 'QObject*'
Generic.cpp:44: error: initializing argument 2 of 'LCD::LCDWrapper::LCDWrapper(LCD::LCDInterface*, QObject*)'
Generic.cpp: In member function 'void LCD::Generic::BuildLayouts()':
Generic.cpp:202: error: invalid conversion from 'void*' to 'LCD::Widget*'
Generic.cpp: In member function 'void LCD::Generic::AddWidget(std::string, unsigned int, unsigned int, std::string)':
Generic.cpp:459: error: invalid conversion from 'void*' to 'LCD::Widget*'
scons: *** [Generic.o] Error 1
여기에 첫 번째입니다 :
Generic(std::string name, Json::Value *config, int type, LCDBase *lcd = NULL);
편집 : 좋아, 주조 명시 적으로 작동을하지만 어떻게 내가 함수에 대한 내느냐 바늘?
NULL을 정의한 후 포함 시키셨습니까? –
무엇을 다시 정의해야할지 모르겠습니다. ORG_NULL에 NULL을 저장하고 libvisual을 포함하여 NULL을 다시 정의하려고 시도했지만 작동하지 않았습니다. – Scott
사실, 그냥 NULL을 적절하게 캐스팅해야한다고 생각합니다. – Scott