gpt4 book ai didi

linux - 编译OpenEXR时遇到 'undefined reference'和 'error adding symbols'

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

我正在安装OpenEXR_ViewersUbuntu 14.04 。运行 makefile 时,我遇到以下错误:

/usr/bin/ld: ImageView.o: undefined reference to symbol 'glOrtho' //usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

我的 lib 工具调用是否可能没有调用 GL?如果是这种情况,我该如何设置我的 libtool 以使用 GL 进行构建? (编辑makefile以查看OpenGl)

Making all in playexr
make[1]: Entering directory `/home/user/Documents/source/openexr/OpenEXR_Viewers/playexr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/Documents/source/openexr/OpenEXR_Viewers/playexr'
Making all in exrdisplay
make[1]: Entering directory `/home/user/Documents/source/openexr/OpenEXR_Viewers/exrdisplay'
/bin/bash ../libtool --tag=CXX --mode=link g++ -pipe -g -O2 -o exrdisplay main.o ImageView.o loadImage.o scaleImage.o applyCtl.o GlWindow3d.o -L/usr/local/lib -pthread -L/usr/local/lib -lIlmImf -lImath-2_2 -lIexMath-2_2 -lHalf -lIex-2_2 -lIlmThread-2_2 -DHAVE_CTL_INTERPRETER=0 -L/usr/local/lib -DHAVE_CTL_INTERPRETER=0 -pthread -L/usr/local/lib -lIlmImf -lImath-2_2 -lIexMath-2_2 -lHalf -lIex-2_2 -lIlmThread-2_2 -Wl,-Bsymbolic-functions -lfltk_gl -lfltk -lX11

*** Warning: Linking the executable exrdisplay against the loadable module
*** libImath-2_2.so is not portable!

*** Warning: Linking the executable exrdisplay against the loadable module
*** libIexMath-2_2.so is not portable!

*** Warning: Linking the executable exrdisplay against the loadable module
*** libHalf.so is not portable!

*** Warning: Linking the executable exrdisplay against the loadable module
*** libIex-2_2.so is not portable!

*** Warning: Linking the executable exrdisplay against the loadable module
*** libIlmThread-2_2.so is not portable!
libtool: link: g++ -pipe -g -O2 -o exrdisplay main.o ImageView.o loadImage.o scaleImage.o applyCtl.o GlWindow3d.o -pthread -DHAVE_CTL_INTERPRETER=0 -DHAVE_CTL_INTERPRETER=0 -pthread -Wl,-Bsymbolic-functions -L/usr/local/lib /usr/local/lib/libIlmImf.so /usr/local/lib/libImath-2_2.so /usr/local/lib/libIexMath-2_2.so /usr/local/lib/libHalf.so /usr/local/lib/libIex-2_2.so /usr/local/lib/libIlmThread-2_2.so -lfltk_gl -lfltk -lX11 -pthread
/usr/bin/ld: ImageView.o: undefined reference to symbol 'glOrtho'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [exrdisplay] Error 1
make[1]: Leaving directory `/home/user/Documents/source/openexr/OpenEXR_Viewers/exrdisplay'
make: *** [all-recursive] Error 1

最佳答案

尝试将 -lglut -lGL (可能还有 -lGLU)添加到链接器命令中。

( g++ linker: /usr/lib/libGL.so.1: could not read symbols: Invalid operation )

更新:

将其附加到:

FLTK_LDFLAGS = -Wl,-Bsymbolic-functions -lfltk_gl -lfltk -lX11

喜欢

FLTK_LDFLAGS = -Wl,-Bsymbolic-functions -lfltk_gl -lfltk -lX11 -lglut -lGL

关于linux - 编译OpenEXR时遇到 'undefined reference'和 'error adding symbols',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29954563/

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