首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

autotools生成动态库遇到的有关问题

2013-07-08 
autotools生成动态库遇到的问题我最近在封装关于海康的linux平台视频转码动态库,代码在linux平台的QT和单

autotools生成动态库遇到的问题
我最近在封装关于海康的linux平台视频转码动态库,代码在linux平台的QT和单纯用g++已经可以编译出适宜使用的动态库,但是现在任务要求用autotools将转码程序做成自动化编译,我搞了两天,还看了国外的官方文档,还是不知道我用autotools做出来的动态库为什么不能用。
我觉得我的Makefile.am有错,但是一直不知道有什么错,我的Makefile.am:
prefix=/usr
lib_LTLIBRARIES=libhikvision.la
libhikvision_la_SOURCES=stdafx.h stdafx.cpp videoconvert.h videoconvert.cpp h264function.h h264function.cpp YV12toRGB.h YV12toRGB.cpp DataType.h
libhikvision_la_LIBADD=-lpthread -lavcodec -lavformat -lavutil -lhcnetsdk -lMPCtrl -lPlayCtrl
libhikvision_la_LDFLAGS=-avoid-version -shared 
libhikvision_la_ACLOCAL_AMFLAGS= -I m4
我的测试程序:
#include<DataType.h>
#include<stdafx.h>
#include<videoconvert.h>

int main()
{

char inputfile[100]="/home/ningge/Desktop/HaikangDvr2.mp4";
char outputfile[100]="/home/ningge/Desktop/HaikangDvr.avi";
SetTransMode(1); //转成标准h264格式
long port = CreateVideoConvertFromLocalFile(inputfile,outputfile);
FrameInfo fi = GetFrameInfo();
printf("Height = %d; Width = %d;totalfram=%d\n", fi.Height, fi.Width,fi.TotalFrames);
long size = fi.Height * fi.Width * 3;
char *pBuf = new char[size];
DWORD start = 1;
DWORD end = 1;
int time_start = clock();

//25帧为一秒,这里转换40秒视频,具体可根据FrameInfo结构体中的总数而定
for (; start<=100; start++,end++)
{//SetTransMode(2);
GetFrameDataRGB24FromLocalFile(port, pBuf, size, start, end);
printf("%d\n", start);
}

int time_end =clock();
printf("the times was %d\n",time_end-time_start);
CloseVideoConvertFromLocalFile(port);
delete pBuf;
//system("pause");
return 0;
;
}
我出现的错误:
[ningge@localhost hikvisiontranso4]$ ./mytranso
SDL Init
init console=1
Output #0, avi, to '/home/ningge/Desktop/HaikangDvr.avi':
    Stream #0.0: Invalid Codec type -1
Height = 576; Width = 704;totalfram=90000
段错误 (core dumped)
希望有大神可以帮帮忙!!!!!!!
Linux automake


[解决办法]
貌似你都编译出动态库了,应该是动态库的关系吧
[解决办法]
进程意外退出会在当前目录下产生形如‘core.数字’的文件比如‘core.1234’
使用命令
gdb 运行程序名 core.数字
进入gdb然后使用bt命令
可以查看进程意外退出前函数调用的堆栈,内容为从上到下列出对应从里层到外层的函数调用历史。
如果进程意外退出不产生core文件,参考“ulimit -c core文件最大块大小”命令

热点排行