请教编译omap的一个例子问题

听海拉拉 2012-04-25 11:59:28
先给出问题:

lenovo@ubuntu:~/test$ make
arm-none-linux-gnueabi-gcc -o luvc_test -L/home/lenovo/work/jpeg/lib luvc_test.c -ljpeg
/home/lenovo/work/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /home/lenovo/work/jpeg/lib/libjpeg.so when searching for -ljpeg
/home/lenovo/work/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /home/lenovo/work/jpeg/lib/libjpeg.a when searching for -ljpeg
/home/lenovo/work/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -ljpeg
collect2: ld returned 1 exit status
make: *** [luvc_test] Error 1



makefile如下:

CROSS=arm-none-linux-gnueabi-

all: luvc_test

luvc_test: luvc_test.c
$(CROSS)gcc -o luvc_test -L/home/lenovo/work/jpeg/lib luvc_test.c -ljpeg

clean:
@rm -vf luvc_test *.o *~







jpeg库的问题,我已经装了,且目录也设置了,怎么找不到呢
...全文
101 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiongmin060102 2012-12-13
  • 打赏
  • 举报
回复
hello,能不能把源码发给我,急需要,非常感谢 xiongmin060102@126.com
听海拉拉 2012-04-26
  • 打赏
  • 举报
回复
源码太长了,发不了,需要的话,留下邮箱
听海拉拉 2012-04-26
  • 打赏
  • 举报
回复

#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/select.h>
#include <sys/time.h>
#include "jpeglib.h"
#include <linux/fb.h>

#include <linux/videodev.h>

#define FB_FILE "/dev/fb0"

typedef struct _fb_v4l
{
int fbfd ;
char *fbp;
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
}fb_v41;

void jpeg_to_framebuffer(fb_v41 *vd, int width, int height, int xoffset, int yoffset, JSAMPARRAY buffer)
{
int x, y, location;
unsigned short *loca_ptr, data;
unsigned char Red, Green, Blue;

for(y = 0; y < height; y++){

location = xoffset * 2 + (y + yoffset) * vd->finfo.line_length;
loca_ptr = (unsigned short *) (vd->fbp + location);

for(x = 0; x < width; x++){
Red = buffer[y][x * 3];
Green = buffer[y][x * 3 + 1];
Blue = buffer[y][x * 3 + 2];
data = ((Red >> 3) << 11) + ((Green >> 2) << 5) + (Blue >> 3) << 0;//rgb565
*(loca_ptr + x) = data;
}
}
}

void yuv_to_framebuffer(fb_v41 *vd, int width, int height, int xoffset, int yoffset, unsigned short *buffer)
{
int x, y, location;
unsigned short *loca_ptr;

for(y = 0; y < height; y++){

location = xoffset * 2 + (y + yoffset) * vd->finfo.line_length;
loca_ptr = (unsigned short *) (vd->fbp + location);

for(x = 0; x < width; x++){
*(loca_ptr + x) = *buffer++;//rgb565
}
}
}


static inline void yuv_to_rgb16(unsigned char y,
unsigned char u,
unsigned char v,
unsigned char *rgb)
{
register int r,g,b;
int rgb16;

r = (1192 * (y - 16) + 1634 * (v - 128) ) >> 10;
g = (1192 * (y - 16) - 833 * (v - 128) - 400 * (u -128) ) >> 10;
b = (1192 * (y - 16) + 2066 * (u - 128) ) >> 10;

r = r > 255 ? 255 : r < 0 ? 0 : r;
g = g > 255 ? 255 : g < 0 ? 0 : g;
b = b > 255 ? 255 : b < 0 ? 0 : b;

rgb16 = (int)(((r >> 3)<<11) | ((g >> 2) << 5)| ((b >> 3) << 0));

*rgb = (unsigned char)(rgb16 & 0xFF);
rgb++;
*rgb = (unsigned char)((rgb16 & 0xFF00) >> 8);
}

void convert(unsigned char *buf, unsigned char *rgb, int width, int height)
{
int x,y,z=0;
int blocks;

blocks = (width * height) * 2;

for (y = 0; y < blocks; y+=4) {
unsigned char Y1, Y2, U, V;

Y1 = buf[y + 0];
U = buf[y + 1];
Y2 = buf[y + 2];
V = buf[y + 3];

yuv_to_rgb16(Y1, U, V, &rgb[y]);
yuv_to_rgb16(Y2, U, V, &rgb[y + 2]);
}
}

昵称很不好取 2012-04-26
  • 打赏
  • 举报
回复
cannot find -ljpeg
找不到这个库了,链接不上,这库有吗?
听海拉拉 2012-04-26
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
cannot find -ljpeg
找不到这个库了,链接不上,这库有吗?
[/Quote]
这个库,我已经编译好了的。在这里-L/home/lenovo/work/jpeg/lib

23,118

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧