How to get Xlib code work in eclipse for C++ ubuntu

半城伤御伤魂 提交于 2019-12-10 23:17:03

问题


I have some code with the following headers for Xlib but don't know what to do to make it work...I can't find these headers.

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>

Sorry new to this.. Okay so now I can view the headers in the foldrrs in my eclipse IDE. and i get the following errors.Thee is no problem with the source as friends have run it from the terminal,and i want to do it from eclipse ide:

In function main': /home/abbas/workspace/test3/Debug/../src/test3.cpp:51: undefined reference toXOpenDisplay'

and many other errors of the same type but the functions are different.

collect2: ld returned 1 exit status make: *** [test3] Error 1

Plzz hellpp!!


回答1:


Right click on Project Folder> Properties> C/C++ Build > Settings > GCC C++ Linker > Libraries > add "X11"



来源:https://stackoverflow.com/questions/3743360/how-to-get-xlib-code-work-in-eclipse-for-c-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!