如何使用jpeglib [英] How to use jpeglib

查看:666
本文介绍了如何使用jpeglib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用jpeglib写一个jpeg文件到我自己的,没有使用预构建功能,如jpeg_compress等等,但写头和表单独...这里有很多问题.. 。

I'm trying to use jpeglib to write a jpeg file to my own, without use the pre-build functions like jpeg_compress etc etc, but writing headers and tables individually... And here there are a lots of problem...

我使用Windows和Visual Studio,所以我试图从gnuwin网站安装.exe文件,并在我的代码中包含4个头文件include 文件夹,但是当我尝试调用一些函数像write_file_header,jpeg_stdio_dest等等,它说,有一个缺少的链接,所以我必须包括每个.c文件,这些功能被实现...

I'm using Windows and Visual Studio, so I tried to install the .exe file from gnuwin site and include in my code the 4 header files of the "include" folder, but when I try to call some functions like write_file_header, jpeg_stdio_dest etc etc, it says that there is a missing link, so I must include every .c file where those function are implemented...

我试图包括src文件,但相同的结果...每个例子我发现只包括标题jpeglib.h没有别的,但在这种方式我不能使用我需要的功能,所以我的问题是,如何正确使用这些库?
谢谢

I tried to include the src files too, but same result... every example I find includes only the header jpeglib.h and nothing else, but in this way I cannot use the functions I need, so my question is, how can I use those libraries properly? thank you

编辑:错误消息是错误C3861:标识符未找到...简单地,当我尝试调用某些函数位于某些.c文件libjpeg,编译器不能找到那些函数是...

the error message is error C3861: identifier not found... simply, when i try to call some function situated in some .c file of the libjpeg, the compiler cannot found where those function are...

编辑n.2:这里的函数的开始:

Edit n.2:here the start of function:

#include "jpeglib.h"
#include "jerror.h"
#include "Common.h"

void jpeg(unsigned int *Src, int srclen, unsigned int *cod, unsigned int *length){

struct jpeg_compress_struct cinfo;

write_file_header(&cinfo); <- here is the problem... how can i access that function?


推荐答案

您应直接使用 .c 文件,你必须告诉你的编译器对库进行链接,就像在本教程

You should not include the .c files directly, you have to tell your compiler to link against the library like in this tutorial.

jpeg库必须单独构建。

The jpeg library has to be built separately.

这篇关于如何使用jpeglib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆