gpt4 book ai didi

ubuntu - libpng.a(pngerror.o) : requires dynamic R_X86_64_PC32 reloc against 'stderr'

转载 作者:行者123 更新时间:2023-12-04 18:26:13 24 4
gpt4 key购买 nike

我在 Ubuntu 20 上,我正在尝试构建 Blender as a Python module .
build instructions 的最后一步是我遇到问题的地方。
我的建筑达到 100%,但随后失败并显示以下输出:

/usr/bin/ld.gold: error: /usr/lib/x86_64-linux-gnu/libpng.a(pngerror.o): requires dynamic R_X86_64_PC32 reloc against 'stderr' which may overflow at runtime; recompile with -fPIC
我试过 sudo make bpy -fPIC ,但这会引发另一个错误:
make: pic: No such file or directory
make: *** No rule to make target 'pic'. Stop.
我假设 -fPIC错误是因为我很愚蠢,我应该用 fpic 支持(或类似的东西)编译 libpng,而不是把它附加到上述命令的末尾,但我真的不知道......
我已经搜索了一段时间,我得到的最接近的答案是 this one ,表示下载并编译 libpng然后用 libpng.a 做点什么(究竟是什么,我不知道)。
我该如何解决这个问题?

最佳答案

编译时在 Makefile 中添加 CFLAGS,如下所示:

CFLAGS = -fPIC -m64 -pthread -Wl,--allow-shlib-undefined -g

...
$(cc) $(CFLAGS) -c $< -o $@ -I ./ -std=c++0x
引用: https://www.collabora.com/about-us/blog/2014/10/01/dynamic-relocs,-runtime-overflows-and-fpic/

关于ubuntu - libpng.a(pngerror.o) : requires dynamic R_X86_64_PC32 reloc against 'stderr' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69683755/

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