- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 MacOS 上编译 libopenshot。
当我运行构建时,我在链接期间收到以下错误:
→ make VERBOSE=1
...
/usr/local/bin/g++-4.9 -std=c++11 -g -ggdb -fopenmp -g -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 14.0.0 -current_version 0.1.9 -o libopenshot.0.1.9.dylib -install_name /source/libopenshot/build/src/libopenshot.14.dylib CMakeFiles/openshot.dir/AudioBufferSource.cpp.o CMakeFiles/openshot.dir/AudioReaderSource.cpp.o CMakeFiles/openshot.dir/AudioResampler.cpp.o CMakeFiles/openshot.dir/CacheBase.cpp.o CMakeFiles/openshot.dir/CacheDisk.cpp.o CMakeFiles/openshot.dir/CacheMemory.cpp.o CMakeFiles/openshot.dir/ChunkReader.cpp.o CMakeFiles/openshot.dir/ChunkWriter.cpp.o CMakeFiles/openshot.dir/Color.cpp.o CMakeFiles/openshot.dir/Clip.cpp.o CMakeFiles/openshot.dir/ClipBase.cpp.o CMakeFiles/openshot.dir/Coordinate.cpp.o CMakeFiles/openshot.dir/CrashHandler.cpp.o CMakeFiles/openshot.dir/DummyReader.cpp.o CMakeFiles/openshot.dir/ReaderBase.cpp.o CMakeFiles/openshot.dir/RendererBase.cpp.o CMakeFiles/openshot.dir/WriterBase.cpp.o CMakeFiles/openshot.dir/EffectBase.cpp.o CMakeFiles/openshot.dir/effects/Bars.cpp.o CMakeFiles/openshot.dir/effects/Blur.cpp.o CMakeFiles/openshot.dir/effects/Brightness.cpp.o CMakeFiles/openshot.dir/effects/ChromaKey.cpp.o CMakeFiles/openshot.dir/effects/ColorShift.cpp.o CMakeFiles/openshot.dir/effects/Crop.cpp.o CMakeFiles/openshot.dir/effects/Deinterlace.cpp.o CMakeFiles/openshot.dir/effects/Hue.cpp.o CMakeFiles/openshot.dir/effects/Mask.cpp.o CMakeFiles/openshot.dir/effects/Negate.cpp.o CMakeFiles/openshot.dir/effects/Pixelate.cpp.o CMakeFiles/openshot.dir/effects/Saturation.cpp.o CMakeFiles/openshot.dir/effects/Shift.cpp.o CMakeFiles/openshot.dir/effects/Wave.cpp.o CMakeFiles/openshot.dir/EffectInfo.cpp.o CMakeFiles/openshot.dir/FFmpegReader.cpp.o CMakeFiles/openshot.dir/FFmpegWriter.cpp.o CMakeFiles/openshot.dir/Fraction.cpp.o CMakeFiles/openshot.dir/Frame.cpp.o CMakeFiles/openshot.dir/FrameMapper.cpp.o CMakeFiles/openshot.dir/KeyFrame.cpp.o CMakeFiles/openshot.dir/ZmqLogger.cpp.o CMakeFiles/openshot.dir/PlayerBase.cpp.o CMakeFiles/openshot.dir/Point.cpp.o CMakeFiles/openshot.dir/Profiles.cpp.o CMakeFiles/openshot.dir/QtImageReader.cpp.o CMakeFiles/openshot.dir/QtPlayer.cpp.o CMakeFiles/openshot.dir/Timeline.cpp.o CMakeFiles/openshot.dir/Qt/AudioPlaybackThread.cpp.o CMakeFiles/openshot.dir/Qt/PlayerDemo.cpp.o CMakeFiles/openshot.dir/Qt/PlayerPrivate.cpp.o CMakeFiles/openshot.dir/Qt/VideoCacheThread.cpp.o CMakeFiles/openshot.dir/Qt/VideoPlaybackThread.cpp.o CMakeFiles/openshot.dir/Qt/VideoRenderWidget.cpp.o CMakeFiles/openshot.dir/Qt/VideoRenderer.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_AudioPlaybackThread.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_PlayerDemo.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_PlayerPrivate.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_VideoCacheThread.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_VideoPlaybackThread.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_VideoRenderWidget.cpp.o CMakeFiles/openshot.dir/__/include/Qt/moc_VideoRenderer.cpp.o CMakeFiles/openshot.dir/__/thirdparty/jsoncpp/src/lib_json/json_reader.cpp.o CMakeFiles/openshot.dir/__/thirdparty/jsoncpp/src/lib_json/json_value.cpp.o CMakeFiles/openshot.dir/__/thirdparty/jsoncpp/src/lib_json/json_writer.cpp.o CMakeFiles/openshot.dir/ImageReader.cpp.o CMakeFiles/openshot.dir/ImageWriter.cpp.o CMakeFiles/openshot.dir/TextReader.cpp.o /usr/local/opt/ffmpeg@2.8/lib/libavformat.dylib /usr/local/opt/ffmpeg@2.8/lib/libavcodec.dylib /usr/local/opt/ffmpeg@2.8/lib/libavutil.dylib /usr/local/opt/ffmpeg@2.8/lib/libavdevice.dylib /usr/local/opt/ffmpeg@2.8/lib/libswscale.dylib /usr/local/opt/ffmpeg@2.8/lib/libavresample.dylib /usr/local/lib/libopenshot-audio.dylib /usr/local/Cellar/qt/5.9.0/lib/QtMultimediaWidgets.framework/QtMultimediaWidgets /usr/local/lib/libzmq.dylib -fopenmp /usr/local/opt/imagemagick@6/lib/libMagick++-6.Q16.dylib /usr/local/opt/imagemagick@6/lib/libMagickWand-6.Q16.dylib /usr/local/opt/imagemagick@6/lib/libMagickCore-6.Q16.dylib /usr/local/Cellar/qt/5.9.0/lib/QtWidgets.framework/QtWidgets /usr/local/Cellar/qt/5.9.0/lib/QtMultimedia.framework/QtMultimedia /usr/local/Cellar/qt/5.9.0/lib/QtGui.framework/QtGui /usr/local/Cellar/qt/5.9.0/lib/QtNetwork.framework/QtNetwork /usr/local/Cellar/qt/5.9.0/lib/QtCore.framework/QtCore
Undefined symbols for architecture x86_64:
"Magick::DrawableFont::DrawableFont(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
openshot::TextReader::Open() in TextReader.cpp.o
"Magick::DrawableText::DrawableText(double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
openshot::TextReader::Open() in TextReader.cpp.o
"Magick::Color::Color(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
openshot::TextReader::Open() in TextReader.cpp.o
"Magick::Image::draw(std::list<Magick::Drawable, std::allocator<Magick::Drawable> > const&)", referenced from:
openshot::TextReader::Open() in TextReader.cpp.o
"Magick::Image::magick(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
openshot::ImageWriter::WriteFrame(std::shared_ptr<openshot::Frame>) in ImageWriter.cpp.o
"Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
openshot::ImageReader::Open() in ImageReader.cpp.o
"Magick::Image::Image(unsigned long, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, MagickCore::StorageType, void const*)", referenced from:
openshot::Frame::GetMagickImage() in Frame.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [src/libopenshot.0.1.9.dylib] Error 1
make[1]: *** [src/CMakeFiles/openshot.dir/all] Error 2
make: *** [all] Error 2
看起来编译器可以找到它:
→ make TextReader.i && grep DrawableFont CMakeFiles/openshot.dir/TextReader.cpp.i
Preprocessing CXX source to CMakeFiles/openshot.dir/TextReader.cpp.i
class __attribute__ ((visibility ("default"))) DrawableFont : public DrawableBase
DrawableFont ( const std::string &font_ );
DrawableFont ( const std::string &family_,
DrawableFont ( const DrawableFont& original_ );
~DrawableFont ( void );
lines.push_back(Magick::DrawableFont(font));
我不明白为什么链接器找不到这些符号。我不知道如何阅读符号表,但看起来它们可能在库中。
→ nm -arch x86_64 -gU /usr/local/opt/imagemagick@6/lib/libMagick++-6.Q16.dylib | grep DrawableFont
0000000000009780 T __ZN6Magick12DrawableFontC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
0000000000009842 T __ZN6Magick12DrawableFontC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEN10MagickCore9StyleTypeEjNSA_11StretchTypeE
00000000000098c2 T __ZN6Magick12DrawableFontC1ERKS0_
0000000000009736 T __ZN6Magick12DrawableFontC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
00000000000097ca T __ZN6Magick12DrawableFontC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEN10MagickCore9StyleTypeEjNSA_11StretchTypeE
000000000000984c T __ZN6Magick12DrawableFontC2ERKS0_
0000000000009914 T __ZN6Magick12DrawableFontD0Ev
000000000000990a T __ZN6Magick12DrawableFontD1Ev
00000000000098cc T __ZN6Magick12DrawableFontD2Ev
00000000000099e0 T __ZNK6Magick12DrawableFont4copyEv
0000000000009942 T __ZNK6Magick12DrawableFontclEPN10MagickCore12_DrawingWandE
000000000002e230 S __ZTIN6Magick12DrawableFontE
00000000000298b0 S __ZTSN6Magick12DrawableFontE
000000000002d060 S __ZTVN6Magick12DrawableFontE
知道可能出了什么问题或者我应该尝试诊断此错误的其他方法吗?
最佳答案
自 C++11 以来,ABI(应用程序二进制接口(interface))发生了变化。这意味着,如果您的某些依赖项是使用 C++98 兼容性编译的,而其他依赖项是使用兼容性优于或等于 C++11 的,则符号名称的解析可能并不总是相同。
因此,您的链接器正在尝试链接具有不同名称的相同符号。
解决方案:使用相同的兼容 ABI 重新编译所有依赖项。在您的情况下,您应该使用 -std=c++11 标志重新编译所有内容。
关于c++ - 为什么找不到这些符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51122417/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!