gpt4 book ai didi

linux - Cimg 链接 eclipse 错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:53:00 25 4
gpt4 key购买 nike

在 ubuntu eclipse 中我想使用 CImg 库:

我的 g++ 选择:

   -I"/home/lukas/Desktop/ressss/resolution_F/re_fol/CImgLib"
-I"/home/lukas/Desktop/ressss/resolution_F/re_fol/Eigen" -O0 -g3 -Wall
-c -fmessage-length=0 -L/usr/X11R6/lib -lm -lpthread -lX11 -lX11
-ltiff -ljpeg -lpng -llapack -lGLU -lGL -ldc1394 -L -lXext -pthread

仍然收到此错误:

make all
Building target: resolution_F
Invoking: GCC C++ Linker

g++ -L/home/lukas/Desktop/CImg-1.7.1_pre033116 -o"resolution_F"
./re_fol/core.o ./re_fol/resolution_F.o
./re_fol/core.o: In function
`cimg_library::cimg::Mutex_info::trylock(unsigned int)':
/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:2875:
undefined reference to `pthread_mutex_trylock'
./re_fol/core.o: In function `cimg_library::CImgDisplay::screen_width()':
/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:7178:
undefined reference to `XOpenDisplay'
/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:7182:
undefined reference to `XCloseDisplay'
./re_fol/core.o: In function `cimg_library::CImgDisplay::screen_height()':
/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:7199:
undefined reference to `XOpenDisplay'

/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:7203:
undefined reference to `XCloseDisplay'
./re_fol/core.o: In function
`cimg_library::CImgDisplay::_handle_events(_XEvent const*)':
/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:7230:
undefined reference to `XUnmapWindow'
/home/lukas/Desktop/ressss/resolution_F/Debug/../re_fol/CImg.h:7236:

我尝试了一切。重新启动,许多选项,.....gcc 4.6 或 gcc 4.7...

最佳答案

您需要将您的代码与 X11 和 pthread 库链接起来。可能您只需要在项目首选项中的某处添加这些编译器选项:

-lpthread -lX11

关于linux - Cimg 链接 eclipse 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36546266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com