首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Arch中安装libx11-dev?(原标题如下)

如何在Arch中安装libx11-dev?(原标题如下)
EN

Stack Overflow用户
提问于 2021-02-19 03:05:15
回答 1查看 461关注 0票数 0

原标题:"Linker error when using C-Turtle library in C++“(在when中使用C海龟库时出现链接器错误)

因此,我决定尝试使用C-turtle库来制作一款吃豆人游戏。但是,为了测试库是否正常工作,我编写了一个小程序:

代码语言:javascript
复制
// All the custom headers
#include "../Headers/C-Turtle/CTurtle.hpp"

//Namespaces
namespace ct = cturtle;

// Main function
int main() {
    ct::TurtleScreen scr;
    ct::Turtle turtle(scr);
    turtle.forward(50);
    return 0;
}

然而,在尝试实现它的过程中,我得到了一个巨大的错误:

代码语言:javascript
复制
[ksp-atlas@ksp-arch PacmanGame]$ make
g++ Sources/main.cpp -o Bin/Pacgame
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::cimg::Mutex_info::trylock(unsigned int)':
main.cpp:(.text._ZN12cimg_library4cimg10Mutex_info7trylockEj[_ZN12cimg_library4cimg10Mutex_info7trylockEj]+0x2b): undefined reference to `pthread_mutex_trylock'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::screen_width()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay12screen_widthEv[_ZN12cimg_library11CImgDisplay12screen_widthEv]+0x2c): undefined reference to `XOpenDisplay'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay12screen_widthEv[_ZN12cimg_library11CImgDisplay12screen_widthEv]+0x9e): undefined reference to `XCloseDisplay'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::screen_height()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay13screen_heightEv[_ZN12cimg_library11CImgDisplay13screen_heightEv]+0x2c): undefined reference to `XOpenDisplay'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay13screen_heightEv[_ZN12cimg_library11CImgDisplay13screen_heightEv]+0x9e): undefined reference to `XCloseDisplay'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_handle_events(_XEvent const*)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x1d4): undefined reference to `XUnmapWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x236): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x326): undefined reference to `XResizeWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x401): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x45a): undefined reference to `XGetWindowAttributes'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x479): undefined reference to `XSync'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x4a2): undefined reference to `XSetInputFocus'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x5e7): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x77a): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x7be): undefined reference to `XLookupString'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x7f8): undefined reference to `XQueryKeymap'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x89e): undefined reference to `XLookupString'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x8ee): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x9d6): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0xa50): undefined reference to `XCheckWindowEvent'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_events_thread(void*)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay14_events_threadEPv[_ZN12cimg_library11CImgDisplay14_events_threadEPv]+0x84): undefined reference to `XCheckTypedEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_events_threadEPv[_ZN12cimg_library11CImgDisplay14_events_threadEPv]+0xb8): undefined reference to `XCheckMaskEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay14_events_threadEPv[_ZN12cimg_library11CImgDisplay14_events_threadEPv]+0x19d): undefined reference to `pthread_testcancel'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_set_colormap(unsigned long&, unsigned int)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay13_set_colormapERmj[_ZN12cimg_library11CImgDisplay13_set_colormapERmj]+0x2a6): undefined reference to `XStoreColors'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_map_window()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay11_map_windowEv[_ZN12cimg_library11CImgDisplay11_map_windowEv]+0x5b): undefined reference to `XMapRaised'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay11_map_windowEv[_ZN12cimg_library11CImgDisplay11_map_windowEv]+0x87): undefined reference to `XWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay11_map_windowEv[_ZN12cimg_library11CImgDisplay11_map_windowEv]+0xe3): undefined reference to `XGetWindowAttributes'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay11_map_windowEv[_ZN12cimg_library11CImgDisplay11_map_windowEv]+0x102): undefined reference to `XSync'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_paint(bool)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay6_paintEb[_ZN12cimg_library11CImgDisplay6_paintEb]+0x127): undefined reference to `XSendEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay6_paintEb[_ZN12cimg_library11CImgDisplay6_paintEb]+0x1b5): undefined reference to `XPutImage'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_init_fullscreen()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x119): undefined reference to `XCreateWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x20d): undefined reference to `XCreateImage'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x23d): undefined reference to `XSelectInput'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x25d): undefined reference to `XMapRaised'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x289): undefined reference to `XWindowEvent'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x30e): undefined reference to `XPutImage'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x339): undefined reference to `XGetWindowAttributes'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay16_init_fullscreenEv[_ZN12cimg_library11CImgDisplay16_init_fullscreenEv]+0x358): undefined reference to `XSync'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_desinit_fullscreen()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay19_desinit_fullscreenEv[_ZN12cimg_library11CImgDisplay19_desinit_fullscreenEv]+0x35): undefined reference to `XUngrabKeyboard'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay19_desinit_fullscreenEv[_ZN12cimg_library11CImgDisplay19_desinit_fullscreenEv]+0x5f): undefined reference to `XDestroyWindow'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::_assign(unsigned int, unsigned int, char const*, unsigned int, bool, bool)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x135): undefined reference to `XOpenDisplay'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x392): undefined reference to `XVisualIDFromVisual'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x3be): undefined reference to `XGetVisualInfo'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x41c): undefined reference to `XFree'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x463): undefined reference to `pthread_create'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x64c): undefined reference to `XCreateWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x6d1): undefined reference to `XCreateSimpleWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x70b): undefined reference to `XSelectInput'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x752): undefined reference to `XStoreName'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x7bb): undefined reference to `XCreateColormap'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x81f): undefined reference to `XSetWindowColormap'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x824): undefined reference to `XAllocClassHint'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x878): undefined reference to `XSetClassHint'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x887): undefined reference to `XFree'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x9a6): undefined reference to `XCreateImage'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0x9d6): undefined reference to `XInternAtom'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0xa02): undefined reference to `XInternAtom'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0xa43): undefined reference to `XSetWMProtocols'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb[_ZN12cimg_library11CImgDisplay7_assignEjjPKcjbb]+0xa88): undefined reference to `XGrabKeyboard'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::assign()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay6assignEv[_ZN12cimg_library11CImgDisplay6assignEv]+0x124): undefined reference to `XDestroyWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay6assignEv[_ZN12cimg_library11CImgDisplay6assignEv]+0x19c): undefined reference to `XFreeColormap'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay6assignEv[_ZN12cimg_library11CImgDisplay6assignEv]+0x1bc): undefined reference to `XSync'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::resize(int, int, bool)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay6resizeEiib[_ZN12cimg_library11CImgDisplay6resizeEiib]+0x28f): undefined reference to `XResizeWindow'
/usr/bin/ld: main.cpp:(.text._ZN12cimg_library11CImgDisplay6resizeEiib[_ZN12cimg_library11CImgDisplay6resizeEiib]+0x2b6): undefined reference to `XGetWindowAttributes'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::close()':
main.cpp:(.text._ZN12cimg_library11CImgDisplay5closeEv[_ZN12cimg_library11CImgDisplay5closeEv]+0x8b): undefined reference to `XUnmapWindow'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `cimg_library::CImgDisplay::move(int, int)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay4moveEii[_ZN12cimg_library11CImgDisplay4moveEii]+0x84): undefined reference to `XMoveWindow'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `void cimg_library::CImgDisplay::_resize<unsigned char>(unsigned char, unsigned int, unsigned int, bool)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay7_resizeIhEEvT_jjb[_ZN12cimg_library11CImgDisplay7_resizeIhEEvT_jjb]+0x12d): undefined reference to `XCreateImage'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `void cimg_library::CImgDisplay::_resize<unsigned short>(unsigned short, unsigned int, unsigned int, bool)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay7_resizeItEEvT_jjb[_ZN12cimg_library11CImgDisplay7_resizeItEEvT_jjb]+0x135): undefined reference to `XCreateImage'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `void cimg_library::CImgDisplay::_resize<unsigned int>(unsigned int, unsigned int, unsigned int, bool)':
main.cpp:(.text._ZN12cimg_library11CImgDisplay7_resizeIjEEvT_jjb[_ZN12cimg_library11CImgDisplay7_resizeIjEEvT_jjb]+0x135): undefined reference to `XCreateImage'
/usr/bin/ld: /tmp/ccXl1Nkp.o: in function `std::thread::thread<cturtle::InteractiveTurtleScreen::initEventThread()::{lambda()#1}, , void>(cturtle::InteractiveTurtleScreen::initEventThread()::{lambda()#1}&&)':
main.cpp:(.text._ZNSt6threadC2IZN7cturtle23InteractiveTurtleScreen15initEventThreadEvEUlvE_JEvEEOT_DpOT0_[_ZNSt6threadC5IZN7cturtle23InteractiveTurtleScreen15initEventThreadEvEUlvE_JEvEEOT_DpOT0_]+0x2f): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make: *** [makefile:5: startmake] Error 1

如果有人能理解这一点发生了什么here?‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌

编辑

我将我的问题定位为没有安装libx11-dev包。我找不到它的Arch,只有基于Debian的发行版。如何安装此软件?

EN

回答 1

Stack Overflow用户

发布于 2021-03-06 07:40:09

我将我的问题本地化为没有包libx11-dev。我找不到它的Arch,只有基于Debian的发行版。如何安装此软件?

Arch只在少数情况下拆分出头部,而x11不是其中之一。x11标头只是libx11的一部分

代码语言:javascript
复制
# pacman -S libx11
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66266541

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档