vendredi 29 juillet 2016

undefined reference to `XkbGetIndicatorState'

I am trying to compile following code in CLION it isn't giving me any errors in the ide.

void EntityListService::aimbot() 
{
   Display* d = XOpenDisplay((char*)0);

   if (d) 
   {
       unsigned n;

       XkbGetIndicatorState(d, XkbUseCoreKbd, &n);

       printf((n & 1)?"caps on\n":"caps off\n");
  }

   std::cout << entityList[1]->getHealth() << std::endl;
   usleep(1);
}

However when I try to run the code I get the following errors

EntityListService.cpp:25: undefined reference to `XOpenDisplay'

EntityListService.cpp:30: undefined reference to XkbGetIndicatorState'

I think it has something to do with adding -lX11 as argument I tried everywhere in the CLION ide to add arguments but nothing works could somebody give a summary on how to add the -lX11 argument when I press the run key.

Aucun commentaire:

Enregistrer un commentaire