• «
  • 1
  • 2
  • »
  • Pages: 2/2     Go
主题 : 库文件明明在那,为什么报没有呢 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 85835
精华: 0
发帖: 17
金钱: 90 两
威望: 18 点
综合积分: 34 分
注册时间: 2013-01-09
最后登录: 2013-03-20
10楼  发表于: 2013-02-17 22:00

 回 9楼(kasim) 的帖子

真的非常感谢您那么耐心,我现在的情况是我就把之前的arm-gcc编译器给删除了,重新弄了一个,然后恩是把ffmpeg重新编译了一遍,报所得库和头文件包含在/usr/local/lib和/usr/local/include
arm-linux-g++ -g -O2 -Wall -I/usr/local/include  -o camera libswscale.cpp -L/usr/local/lib -lavutil -lavformat -lavcodec -lavutil  -lswscale -lgcc
libswscale.cpp:37: warning: deprecated conversion from string constant to 'char*'
libswscale.cpp:43: warning: deprecated conversion from string constant to 'char*'
libswscale.cpp:44: warning: deprecated conversion from string constant to 'char*'
libswscale.cpp: In function 'int read_frame()':
libswscale.cpp:135: warning: unused variable 'i'
libswscale.cpp: In function 'int main(int, char**)':
libswscale.cpp:287: warning: label 'unmap' defined but not used
libswscale.cpp: At global scope:
libswscale.cpp:46: warning: 'file_name' defined but not used
/usr/local/arm/4.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libx264.so.115, needed by /usr/local/lib/libavutil.so, not found (try using -rpath or -rpath-link)
/usr/local/arm/4.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libz.so.1, needed by /usr/local/lib/libavformat.so, not found (try using -rpath or -rpath-link)
/tmp/ccCKrf27.o: In function `Convert422_420':
/home/andyhx/Desktop/libcreate/libswscale.cpp:100: undefined reference to `sws_getContext(int, int, PixelFormat, int, int, PixelFormat, int, SwsFilter*, SwsFilter*, double*)'
/home/andyhx/Desktop/libcreate/libswscale.cpp:115: undefined reference to `sws_scale(SwsContext*, unsigned char**, int*, int, int, unsigned char**, int*)'
/home/andyhx/Desktop/libcreate/libswscale.cpp:125: undefined reference to `sws_freeContext(SwsContext*)'
/usr/local/lib/libavcodec.so: undefined reference to `inflateReset'
/usr/local/lib/libavformat.so: undefined reference to `inflateEnd'
/usr/local/lib/libavcodec.so: undefined reference to `compress'
/usr/local/lib/libavcodec.so: undefined reference to `deflate'
/usr/local/lib/libavcodec.so: undefined reference to `deflateInit_'
/usr/local/lib/libavcodec.so: undefined reference to `x264_encoder_encode'
/usr/local/lib/libavformat.so: undefined reference to `inflate'
/usr/local/lib/libavcodec.so: undefined reference to `inflateSync'
/usr/local/lib/libavcodec.so: undefined reference to `compress2'
/usr/local/lib/libavcodec.so: undefined reference to `crc32'
/usr/local/lib/libavcodec.so: undefined reference to `deflateEnd'
/usr/local/lib/libavcodec.so: undefined reference to `deflateReset'
/usr/local/lib/libavcodec.so: undefined reference to `x264_param_default'
/usr/local/lib/libavcodec.so: undefined reference to `x264_encoder_headers'
/usr/local/lib/libavformat.so: undefined reference to `inflateInit_'
/usr/local/lib/libavcodec.so: undefined reference to `deflateInit2_'
/usr/local/lib/libavcodec.so: undefined reference to `x264_encoder_close'
/usr/local/lib/libavcodec.so: undefined reference to `x264_encoder_open_115'
/usr/local/lib/libavformat.so: undefined reference to `uncompress'
collect2: ld returned 1 exit status
make: *** [camera] Error 1
[ 此帖被王海天在2013-02-17 22:25重新编辑 ]
级别: 新手上路
UID: 85835
精华: 0
发帖: 17
金钱: 90 两
威望: 18 点
综合积分: 34 分
注册时间: 2013-01-09
最后登录: 2013-03-20
11楼  发表于: 2013-02-17 22:11

 回 9楼(kasim) 的帖子

描述:/usr/local/lib所拥有的库
图片:
如下是/etc/ld.so.conf文件 root@andyhx-virtual-machine:~/Desktop/libcreate# cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
/usr/local/lib
如下我的makefile
CC=arm-linux-g++
CFLAGS=-g -O2 -Wall -I/usr/local/include
LDFLAGS= -L/usr/local/lib -lavutil -lavformat -lavcodec -lavutil  -lswscale -lgcc
TARGETS=camera
all: $(TARGETS)
camera:libswscale.cpp
    $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
    rm -rf $(TARGETS)
[ 此帖被王海天在2013-02-17 22:23重新编辑 ]
级别: 新手上路
UID: 85835
精华: 0
发帖: 17
金钱: 90 两
威望: 18 点
综合积分: 34 分
注册时间: 2013-01-09
最后登录: 2013-03-20
12楼  发表于: 2013-02-18 16:50

 回 9楼(kasim) 的帖子

非常感谢你,我现在已经ok了,可能原因是之前的 ffmpeg没有编译好,还有个原因是 makefile里的LDflags要增加 -lbx264和-lz,非常 感谢您的帮助
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
13楼  发表于: 2013-02-18 17:01

 回 12楼(王海天) 的帖子

恭喜问题解决。
其实解决问题最终靠的还是你自己,仔细分析出错信息是关键。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
  • «
  • 1
  • 2
  • »
  • Pages: 2/2     Go