Possible Duplicate:
Qt 4.7.4: Is there a way to find out the status of CAPS LOCK?
How to detect capslock key status in qt on mac os x. I have tried
Display * d = XOpenDisplay((char*)0);
bool caps_state = false;
if (d)
 {
  unsigned n;
  XkbGetIndicatorState(d, XkbUseCoreKbd, &n);
  caps_state = (n & 0x01) == 1;
 }
 return caps_state;
but it giving me following error:
Undefined symbols for architecture x86_64:
"_XOpenDisplay", referenced from: .o myclass::GetCapslockState()
  myclass::keyEvent(QKeyEvent*)     
"_XkbGetIndicatorState", referenced from: .o
  myclass::GetCapslockState()       in .o
  myclass::keyEvent(QKeyEvent*)      in .o
ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status
I am new to qt devlopment. I am not getting why it is showing me this error. I have included "#include " header file. If anyone knows please help me.