当前位置: 技术问答>linux和unix
未定义引用
来源: 互联网 发布时间:2016-03-13
本文导语: 大家好 在头文件jpeg_encoder.h中有如下定义: extern void InitEncoder(int quality,int color_space); extern int CompressImage( unsigned char *pInBuf, //source data, bgr format, 3 bytes per pixel unsigned char *pOutBuf,//destination buffer, in jpg f...
大家好
在头文件jpeg_encoder.h中有如下定义:
extern void InitEncoder(int quality,int color_space);
extern int CompressImage(
unsigned char *pInBuf, //source data, bgr format, 3 bytes per pixel
unsigned char *pOutBuf,//destination buffer, in jpg format
int nWidthPix, //image width in pixels
int nHeight, //height
int *nOutputBytes //return number of bytes being written
);
在主程序imgview.c中#include "jpeg_encoder.h"并有如下引用:
InitEncoder(70, YUV420_INPUT);
CompressImage(out_buff,in_buff,yuv_width,yuv_height,&nOutputBytes);
而我在make时出现以下错误:
_InitEncoder未定义引用;
_CompressImage未定义引用;
请问下这是怎么回事呢?怎么解决?
在头文件jpeg_encoder.h中有如下定义:
extern void InitEncoder(int quality,int color_space);
extern int CompressImage(
unsigned char *pInBuf, //source data, bgr format, 3 bytes per pixel
unsigned char *pOutBuf,//destination buffer, in jpg format
int nWidthPix, //image width in pixels
int nHeight, //height
int *nOutputBytes //return number of bytes being written
);
在主程序imgview.c中#include "jpeg_encoder.h"并有如下引用:
InitEncoder(70, YUV420_INPUT);
CompressImage(out_buff,in_buff,yuv_width,yuv_height,&nOutputBytes);
而我在make时出现以下错误:
_InitEncoder未定义引用;
_CompressImage未定义引用;
请问下这是怎么回事呢?怎么解决?
|
试试:
gcc -o prog imgview.o /root/bf/jpeglib.a
gcc -o prog imgview.o /root/bf/jpeglib.a
|
再试试:
bfin-uclinux-gcc -Wl,-elf2flt -o imgview imgview.o senddata.o -lpthread /root/bf/jpeglib.a -L/root/bf531/uClinux-dist-usb/lib/
bfin-uclinux-gcc -Wl,-elf2flt -o imgview imgview.o senddata.o -lpthread /root/bf/jpeglib.a -L/root/bf531/uClinux-dist-usb/lib/
|
-L/root/bf/jpeglib.a ??
try -L/root/bf -ljpeglib
try -L/root/bf -ljpeglib
|
|
extern 本来就是外部的,还需要C文件
|
还应该链接相应的库文件