我需要构建iDS的SimpleStreamer应用程序
我有以下结构的档案:
.
├── bin
│ └── ueye_streamer
├── doc
. .
. .
│ └── ueye__stream_8h_source.html
├── include
│ └── ueye_stream.h
├── lib
│ ├── ffmpeg
│ │ ├── libavcodec.so
│ │ ├── libavcodec.so.56
│ │ ├── libavcodec.so.56.60.100
│ │ ├── libavdevice.so
│ │ ├── libavdevice.so.56
│ │ ├── libavdevice.so.56.4.100
│ │ ├── libavfilter.so
│ │ ├── libavfilter.so.5
│ │ ├── libavfilter.so.5.40.101
│ │ ├── libavformat.so
│ │ ├── libavformat.so.56
│ │ ├── libavformat.so.56.40.101
│ │ ├── libavutil.so
│ │ ├── libavutil.so.54
│ │ ├── libavutil.so.54.31.100
│ │ ├── libswresample.so
│ │ ├── libswresample.so.1
│ │ ├── libswresample.so.1.2.101
│ │ ├── libswscale.so
│ │ ├── libswscale.so.3
│ │ └── libswscale.so.3.1.101
│ ├── libueye_stream.so -> libueye_stream.so.2
│ ├── libueye_stream.so.2 -> libueye_stream.so.2.0
│ ├── libueye_stream.so.2.0
│ └── live555
│ ├── libBasicUsageEnvironment.so
│ ├── libBasicUsageEnvironment.so.1
│ ├── libBasicUsageEnvironment.so.1.0.0
│ ├── libgroupsock.so
│ ├── libgroupsock.so.8
│ ├── libgroupsock.so.8.1.0
│ ├── libliveMedia.so
│ ├── libliveMedia.so.52
│ ├── libliveMedia.so.52.0.4
│ ├── libUsageEnvironment.so
│ ├── libUsageEnvironment.so.3
│ └── libUsageEnvironment.so.3.1.0
├── licenses
│ ├── thirdparty_copyrights.txt
│ ├── thirdparty_licenses.txt
│ └── thirdparty_rights.txt
├── README.txt
├── src
│ ├── SimpleStreamer
│ │ ├── build
│ │ ├── CMakeLists.txt
│ │ ├── libueye_stream.so
│ │ ├── libueye_stream.so.2.0
│ │ ├── main.cpp
│ │ └── ueye_stream.h
│ └── uEyeStreamer
│ ├── build
│ ├── CMakeLists.txt
│ ├── res
│ ├── src
│ ├── streamer.qrc
│ ├── streamer.rc.in
│ └── uEye_Streamer.ico
└── ueye_streamer.sh
字符串
以下是SimpleStreamer的CMakeLists.txt
的内容:
project(SimpleStream)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ueye_api ueye_stream)
型
我将项目的常用lib
和include
文件夹复制到系统范围的lib
和include
:
sudo cp include/ueye_stream.h /usr/local/include/
sudo cp lib/libueye_stream.so.2.0 /usr/local/lib/
型
我以与/usr/local/lib
和项目的lib
相同的方式创建了符号链接:
lrwxrwxrwx 1 olga olga 19 июн 21 2016 libueye_stream.so -> libueye_stream.so.2
lrwxrwxrwx 1 olga olga 21 июн 21 2016 libueye_stream.so.2 -> libueye_stream.so.2.0
-rwxr-xr-x 1 olga olga 151018 июн 21 2016 libueye_stream.so.2.0
的
我做了sudo ldconfig
没有任何错误。
我从SimpleStreamer的build
目录中做了cmake ..
:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/olga/camera/ueye/ueye_stream/ueye_stream_x64/src/SimpleStreamer/build
型
但是当我继续到make
阶段时,我得到了很多错误:
olga@olga-MS-7758:~/camera/ueye/ueye_stream/ueye_stream_x64/src/SimpleStreamer/build$ make
[ 50%] Linking CXX executable SimpleStream
/usr/bin/ld: warning: libliveMedia.so.52, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libgroupsock.so.8, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libBasicUsageEnvironment.so.1, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libUsageEnvironment.so.3, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavcodec.so.56, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavfilter.so.5, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavutil.so.54, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libswscale.so.3, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavformat.so.56, needed by //usr/local/lib/libueye_stream.so, not found (try using -rpath or -rpath-link)
//usr/local/lib/libueye_stream.so: undefined reference to `FramedSource::doStopGettingFrames()'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_decode_video2@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isServerMediaSession() const'
//usr/local/lib/libueye_stream.so: undefined reference to `FramedSource::afterGetting(FramedSource*)'
//usr/local/lib/libueye_stream.so: undefined reference to `BasicUsageEnvironment::createNew(TaskScheduler&)'
//usr/local/lib/libueye_stream.so: undefined reference to `avpicture_get_size@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::setStreamSourceDuration(FramedSource*, double, unsigned long&)'
//usr/local/lib/libueye_stream.so: undefined reference to `av_free@LIBAVUTIL_54'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `ServerMediaSession::addSubsession(ServerMediaSubsession*)'
//usr/local/lib/libueye_stream.so: undefined reference to `FramedSource::~FramedSource()'
//usr/local/lib/libueye_stream.so: undefined reference to `typeinfo for OnDemandServerMediaSubsession'
//usr/local/lib/libueye_stream.so: undefined reference to `av_frame_free@LIBAVUTIL_54'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::seekStream(unsigned int, void*, char*&, char*&)'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_get_context_defaults3@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::startStream(unsigned int, void*, void (*)(void*), void*, unsigned short&, unsigned int&, void (*)(void*, unsigned char), void*)'
//usr/local/lib/libueye_stream.so: undefined reference to `ServerMediaSubsession::testScaleFactor(float&)'
//usr/local/lib/libueye_stream.so: undefined reference to `JPEGVideoSource::JPEGVideoSource(UsageEnvironment&)'
//usr/local/lib/libueye_stream.so: undefined reference to `JPEGVideoSource::~JPEGVideoSource()'
//usr/local/lib/libueye_stream.so: undefined reference to `H264VideoRTPSink::createNew(UsageEnvironment&, Groupsock*, unsigned char)'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isRTSPClient() const'
//usr/local/lib/libueye_stream.so: undefined reference to `RTSPServer::rtspURL(ServerMediaSession const*, int) const'
//usr/local/lib/libueye_stream.so: undefined reference to `GenericMediaServer::addServerMediaSession(ServerMediaSession*)'
//usr/local/lib/libueye_stream.so: undefined reference to `sws_freeContext@LIBSWSCALE_3'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::getCurrentNPT(void*)'
//usr/local/lib/libueye_stream.so: undefined reference to `JPEGVideoSource::restartInterval()'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isRTPSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::deleteStream(unsigned int, void*&)'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::getRTPSinkandRTCP(void*, RTPSink const*&, RTCPInstance const*&)'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isDVVideoStreamFramer() const'
//usr/local/lib/libueye_stream.so: undefined reference to `Port::Port(unsigned short)'
//usr/local/lib/libueye_stream.so: undefined reference to `av_new_packet@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::getStreamParameters(unsigned int, unsigned int, Port const&, Port const&, int, unsigned char, unsigned char, unsigned int&, unsigned char&, unsigned char&, Port&, Port&, void*&)'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isMPEG1or2VideoStreamFramer() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::sdpLines()'
//usr/local/lib/libueye_stream.so: undefined reference to `BasicTaskScheduler::createNew(unsigned int)'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::seekStreamSource(FramedSource*, double&, double, unsigned long&)'
//usr/local/lib/libueye_stream.so: undefined reference to `FramedSource::maxFrameSize() const'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_open2@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::~OnDemandServerMediaSubsession()'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isAMRAudioSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isH265VideoStreamFramer() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::nullSeekStream(unsigned int, void*, double, unsigned long&)'
//usr/local/lib/libueye_stream.so: undefined reference to `av_frame_alloc@LIBAVUTIL_54'
//usr/local/lib/libueye_stream.so: undefined reference to `avpicture_fill@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::OnDemandServerMediaSubsession(UsageEnvironment&, unsigned char, unsigned short, unsigned char)'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::createGroupsock(in_addr const&, Port)'
//usr/local/lib/libueye_stream.so: undefined reference to `ServerMediaSubsession::getAbsoluteTimeRange(char*&, char*&) const'
//usr/local/lib/libueye_stream.so: undefined reference to `ServerMediaSession::createNew(UsageEnvironment&, char const*, char const*, char const*, unsigned char, char const*)'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isRTCPInstance() const'
//usr/local/lib/libueye_stream.so: undefined reference to `JPEGVideoRTPSink::createNew(UsageEnvironment&, Groupsock*)'
//usr/local/lib/libueye_stream.so: undefined reference to `GenericMediaServer::deleteServerMediaSession(ServerMediaSession*)'
//usr/local/lib/libueye_stream.so: undefined reference to `av_free_packet@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `ServerMediaSubsession::duration() const'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isRTSPServer() const'
//usr/local/lib/libueye_stream.so: undefined reference to `av_register_all@LIBAVFORMAT_56'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::getAttributes() const'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_encode_video2@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `avformat_new_stream@LIBAVFORMAT_56'
//usr/local/lib/libueye_stream.so: undefined reference to `FramedSource::isFramedSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `H264VideoStreamDiscreteFramer::createNew(UsageEnvironment&, FramedSource*)'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isSink() const'
//usr/local/lib/libueye_stream.so: undefined reference to `typeinfo for JPEGVideoSource'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::setStreamSourceScale(FramedSource*, float)'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::seekStream(unsigned int, void*, double&, double, unsigned long&)'
//usr/local/lib/libueye_stream.so: undefined reference to `OutPacketBuffer::maxSize'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::close(Medium*)'
//usr/local/lib/libueye_stream.so: undefined reference to `UsageEnvironment::reclaim()'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::MIMEtype() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::getAuxSDPLine(RTPSink*, FramedSource*)'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_close@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `av_init_packet@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::closeStreamSource(FramedSource*)'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isMPEG4VideoStreamFramer() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::pauseStream(unsigned int, void*)'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isJPEGVideoSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_find_decoder@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `av_malloc@LIBAVUTIL_54'
//usr/local/lib/libueye_stream.so: undefined reference to `Medium::isMediaSession() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::createRTCP(Groupsock*, unsigned int, unsigned char const*, RTPSink*)'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_alloc_context3@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `avcodec_find_encoder@LIBAVCODEC_56'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::setStreamScale(unsigned int, void*, float)'
//usr/local/lib/libueye_stream.so: undefined reference to `sws_getContext@LIBSWSCALE_3'
//usr/local/lib/libueye_stream.so: undefined reference to `JPEGVideoSource::isJPEGVideoSource() const'
//usr/local/lib/libueye_stream.so: undefined reference to `MediaSource::isH264VideoStreamFramer() const'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::getStreamSource(void*)'
//usr/local/lib/libueye_stream.so: undefined reference to `FramedSource::FramedSource(UsageEnvironment&)'
//usr/local/lib/libueye_stream.so: undefined reference to `av_log_set_level@LIBAVUTIL_54'
//usr/local/lib/libueye_stream.so: undefined reference to `OnDemandServerMediaSubsession::seekStreamSource(FramedSource*, char*&, char*&)'
//usr/local/lib/libueye_stream.so: undefined reference to `RTSPServer::createNew(UsageEnvironment&, Port, UserAuthenticationDatabase*, unsigned int)'
//usr/local/lib/libueye_stream.so: undefined reference to `typeinfo for FramedSource'
//usr/local/lib/libueye_stream.so: undefined reference to `sws_scale@LIBSWSCALE_3'
collect2: error: ld returned 1 exit status
CMakeFiles/SimpleStream.dir/build.make:94: recipe for target 'SimpleStream' failed
make[2]: *** [SimpleStream] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/SimpleStream.dir/all' failed
make[1]: *** [CMakeFiles/SimpleStream.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
型
在README.md项目的根目录中,我没有任何关于头文件和库的安装。
更新
olga@olga-MS-7758:~/camera/ueye/ueye_stream/ueye_stream_x64/lib$ nm -C -u libwx_baseu-2.8.so libueye_stream.so.2.0
nm: 'libwx_baseu-2.8.so': No such file
libueye_stream.so.2.0:
U avcodec_alloc_context3@@LIBAVCODEC_56
.
.
型
系统版本:
olga@olga-MS-7758:~/camera/ueye/ueye_stream/ueye_stream_x64/lib$ lsb_release -a
\No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
olga@olga-MS-7758:~/camera/ueye/ueye_stream/ueye_stream_x64/lib$ uname -r
4.18.0-16-generic
olga@olga-MS-7758:~/camera/ueye/ueye_stream/ueye_stream_x64/lib$
型ldd
的结果:
olga@olga-MS-7758:~/camera/ueye/ueye_stream/ueye_stream_x64/lib$ ldd libueye_stream.so.2.0
linux-vdso.so.1 (0x00007fff56183000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f215cbb5000)
libliveMedia.so.52 => not found
libgroupsock.so.8 => not found
libBasicUsageEnvironment.so.1 => not found
libUsageEnvironment.so.3 => not found
libavcodec.so.56 => not found
libavfilter.so.5 => not found
libavutil.so.54 => not found
libswscale.so.3 => not found
libavformat.so.56 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f215c82c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f215c48e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f215c276000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f215be85000)
/lib64/ld-linux-x86-64.so.2 (0x00007f215cfee000)
型
1条答案
按热度按时间rmbxnbpk1#
好的,在阅读了一些理论资料和“演绎思维”(c)之后,我找到了解决方法:
1.我创建了文件夹
/usr/local/lib/ueye_olga
1.我从项目根
lib
及其子文件夹中复制了所有必要库到ueye_olga
,请参见下面输出1.我删除了不必要的文件,并用链接替换了它们(请参阅下面的说明)
1.我创建了
/etc/ld.so.conf.d/ueye_olga.conf with path to the
/usr/local/lib/ueye_olga ',请参见下面的内容。1.我做了
sudo ldconfig
1.我检查了
libueye_stream.so
是否正确链接(见下文)1.我需要移动
libueye_stream.so
和它的链接文件夹了,我不知道为什么,看到下面的错误.1.再次
sudo ldconfig
make
工作正常./usr/local/lib/ueye_olga ':用户名和密码
字符串
删除不必要的文件:
如果不创建软链接,则会出现以下错误:
/sbin/ldconfig.真实的:/usr/local/lib/ueye_olga/libavcodec.so.56不是符号链接
其理由:
与库模块一样,libstdc通常可以安装为多个版本中的一个。通常只安装一个版本,其他可能的版本表示为指向已安装版本的符号链接。符号链接是指向已安装模块的另一个名称。例如,我安装了/usr/lib/libstdc++.so.6.0.10。我也安装了/usr/liblibstdc++。.so.6作为指向/usr/lib/libstdc++.so.6.0.10的符号链接,这样您就可以使用这两个名称访问libstdc++。
取自here。
/etc/ld.so.conf.d/ueye_olga.conf
:型
正确链接的ueye_stream:
型
libueye_stream.so
与软链接移动到/usr/local/lib
。*make
成功:型