需要帮助从libjpeg编译jpegtran.c代码 [英] Need help compiling jpegtran.c code from libjpeg

查看:610
本文介绍了需要帮助从libjpeg编译jpegtran.c代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看底部的更新



我遇到了一些奇怪的问题。对于初学者,我使用最新的Eclipse CDT,并且在实现 do_rot_180 之前,编译器将文件夹 projectName / include 链接起来,但现在需要具体的include / *。h指定



与该问题相关,在项目资源管理器中,似乎认为libjpeg.h丢失或无效,尽管它位于磁盘上的文件夹中。 p>

我正在使用libjpeg-9。





包含(包含什么是transupp.c和example.c):





功能(do_rot_180来自transupp.c,read_JPEG_file来自example.c):

 请参阅编辑2下的更新代码块(几乎只是jpegtran.c代码)

这是ROTAT在jpegtran.c中未使用的e函数:
// LOCAL(void)
// do_rot_180(j_decompress_ptr srcinfo,j_compress_ptr dstinfo,
// JDIMENSION x_crop_offset,JDIMENSION y_crop_offset,
// jvirt_barray_ptr * src_coef_arrays,
// jvirt_barray_ptr * dst_coef_arrays)
/// * 180度旋转相当于
// * 1.垂直镜像;
// * 2.水平镜像。
// *这两个步骤被合并到单个处理例程中。
// * /
// {
// JDIMENSION MCU_cols,MCU_rows,comp_width,comp_height,dst_blk_x,dst_blk_y;
// JDIMENSION x_crop_blocks,y_crop_blocks;
// int ci,i,j,offset_y;
// JBLOCKARRAY src_buffer,dst_buffer;
// JBLOCKROW src_row_ptr,dst_row_ptr;
// JCOEFPTR src_ptr,dst_ptr;
// jpeg_component_info * compptr;
//
// MCU_cols = srcinfo-> output_width /
//(dstinfo-> max_h_samp_factor * dstinfo-> min_DCT_h_scaled_size);
// MCU_rows = srcinfo-> output_height /
//(dstinfo-> max_v_samp_factor * dstinfo-> min_DCT_v_scaled_size);
//
// for(ci = 0; ci< dstinfo-> num_components; ci ++){
// compptr = dstinfo-> comp_info + ci;
// comp_width = MCU_cols * compptr-> h_samp_factor;
// comp_height = MCU_rows * compptr-> v_samp_factor;
// x_crop_blocks = x_crop_offset * compptr-> h_samp_factor;
// y_crop_blocks = y_crop_offset * compptr-> v_samp_factor;
// for(dst_blk_y = 0; dst_blk_y< compptr-> height_in_blocks;
// dst_blk_y + = compptr-> v_samp_factor){
// dst_buffer =(* srcinfo-> ; mem-> access_virt_barray)
//((j_common_ptr)srcinfo,dst_coef_arrays [ci],dst_blk_y,
//(JDIMENSION)compptr-> v_samp_factor,TRUE);
// if(y_crop_blocks + dst_blk_y< comp_height){
// / *行位于垂直可镜像区域内。 * /
// src_buffer =(* srcinfo-> mem-> access_virt_barray)
//((j_common_ptr)srcinfo,src_coef_arrays [ci],
// comp_height - y_crop_blocks - dst_blk_y -
//(JDIMENSION)compptr-> v_samp_factor,
//(JDIMENSION)compptr-> v_samp_factor,FALSE);
//} else {
// / *底边行只能水平镜像。 * /
// src_buffer =(* srcinfo-> mem-> access_virt_barray)
//((j_common_ptr)srcinfo,src_coef_arrays [ci],
// dst_blk_y + y_crop_blocks,
//(JDIMENSION)compptr-> v_samp_factor,FALSE);
//}
// for(offset_y = 0; offset_y< compptr-> v_samp_factor; offset_y ++){
// dst_row_ptr = dst_buffer [offset_y];
// if(y_crop_blocks + dst_blk_y< comp_height){
// / * Row在可镜像区域内。 * /
// src_row_ptr = src_buffer [compptr-> v_samp_factor - offset_y - 1];
// for(dst_blk_x = 0; dst_blk_x< compptr-> width_in_blocks; dst_blk_x ++){
// dst_ptr = dst_row_ptr [dst_blk_x];
// if(x_crop_blocks + dst_blk_x< comp_width){
// / *处理可以双向镜像的块。 * /
// src_ptr = src_row_ptr [comp_width - x_crop_blocks - dst_blk_x - 1];
// for(i = 0; i // / *对于偶数行,否定每个奇数列。 * /
// for(j = 0; j // * dst_ptr ++ = * src_ptr ++;
// * dst_ptr ++ = - * src_ptr ++;
//}
// / *对于奇数行,否定每个偶数列。 * /
// for(j = 0; j // * dst_ptr ++ = - * src_ptr ++;
// * dst_ptr ++ = * src_ptr ++;
//}
//}
//} else {
// / *任何剩余的右边框只能垂直镜像。 * /
// src_ptr = src_row_ptr [x_crop_blocks + dst_blk_x];
// for(i = 0; i // for(j = 0; j // * dst_ptr ++ = * src_ptr ++;
// for(j = 0; j // * dst_ptr ++ = - * src_ptr ++;
//}
//}
//}
//} else {
// / *剩余的行只是水平镜像。 * /
// src_row_ptr = src_buffer [offset_y];
// for(dst_blk_x = 0; dst_blk_x< compptr-> width_in_blocks; dst_blk_x ++){
// if(x_crop_blocks + dst_blk_x< comp_width){
// / *可以镜像的块。 * /
// dst_ptr = dst_row_ptr [dst_blk_x];
// src_ptr = src_row_ptr [comp_width - x_crop_blocks - dst_blk_x - 1];
// for(i = 0; i // * dst_ptr ++ = * src_ptr ++;
// * dst_ptr ++ = - * src_ptr ++;
//}
//} else {
// / *仅复制任何剩余的右边块。 * /
// jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
// dst_row_ptr + dst_blk_x,
//(JDIMENSION)1);
//}
//}
//}
//}
//}
//}
//}

除此之外,我找不到位于 jcopy_block_row 的位置。我查看了所有的include文件及其.c对应文件。



我在read_JPEG_file函数中注释出错误处理的东西,并希望从内部调用do_rot_180我没有得到那么远。



我发现的唯一线索是在transupp.c中:





附加注意事项: jpegtran.exe与编译的.DLL分开工作,所以它必须在某个地方。






编辑 - 复制jpegint.h

  #ifdef JPEG_INTERNALS 
#includejpegint.h/ * fetch私人声明* /
#includejerror.h/ *提取错误代码* /
#endif

现在无法编译,尽管它们似乎都在jpeglib.h或jpegint.h中声明:








编辑2 - 代码现在包含jpegtran.c能够旋转180度。更新代码块:

  / ********************* ************************************************** ********** / 
/ *定义* /
/ ************************* ************************************************** ****** /

#define JPEG_INTERNALS

/ ************************* ************************************************** ******** /
/ *包含* /
/ *************************** ************************************************** **** /

#include< stdio.h>
#include< iostream>

#includejinclude.h
#includejpeglib.h
#includecdjpeg.h
#includetransupp.h
#includejerror.h

#include< ctype.h>
#include< setjmp.h>

// using namespace std;


static char * infilename;
static char * outfilename;
static JCOPY_OPTION copyoption;
static jpeg_transform_info transformoption;

FILE * infile;
FILE * outfile;


void openFile(char file){
if(file =='i'){
infile = fopen(infilename,rb);
}
else if(file =='o'){
outfile = fopen(outfilename,wb);
}
}

/ ******************************* ************************************************** /
/ *主执行块* /
/ *********************************** ************************************************ /

int main(){
struct jpeg_decompress_struct srcinfo;
struct jpeg_compress_struct dstinfo;
struct jpeg_error_mgr jsrcerr,jdsterr;

jvirt_barray_ptr * src_coef_arrays;
jvirt_barray_ptr * dst_coef_arrays;
// int file_index;

srcinfo.err = jpeg_std_error(& jsrcerr);
jpeg_create_decompress(& srcinfo);
dstinfo.err = jpeg_std_error(& jdsterr);
jpeg_create_compress(& dstinfo);

jsrcerr.trace_level = jdsterr.trace_level;
srcinfo.mem-> max_memory_to_use = dstinfo.mem-> max_memory_to_use;

//

outfilename = NULL;
copyoption = JCOPYOPT_DEFAULT;
transformoption.transform = JXFORM_NONE;
transformoption.trim = FALSE;
transformoption.force_grayscale = FALSE;

transformoption.transform = JXFORM_ROT_180;

//

std :: cout<<< 输入文件名旋转180度。 <<的std :: ENDL;
std :: cin>> infilename;
openFile('i');
std :: cout<<< 输入输出文件名。 <<的std :: ENDL;
std :: cin>> outfilename;
openFile('o');

//

jpeg_stdio_src(& srcinfo,infile);
jcopy_markers_setup(& srcinfo,copyoption);
(void)jpeg_read_header(& srcinfo,TRUE);

jtransform_request_workspace(& srcinfo& transformoption);

src_coef_arrays = jpeg_read_coefficients(& srcinfo);
jpeg_copy_critical_parameters(& srcinfo,& dstinfo);

dst_coef_arrays = jtransform_adjust_parameters(& srcinfo,& dstinfo,
src_coef_arrays,
& transformoption);

jpeg_stdio_dest(& dstinfo,outfile);
jpeg_write_coefficients(& dstinfo,dst_coef_arrays);
jcopy_markers_execute(& srcinfo,& dstinfo,copyoption);

jtransform_execute_transformation(& srcinfo,& dstinfo,
src_coef_arrays,
& transformoption);

jpeg_finish_compress(& dstinfo);
jpeg_destroy_compress(& dstinfo);
(void)jpeg_finish_decompress(& srcinfo);
jpeg_destroy_decompress(& srcinfo);

//

if(infile!= stdin)
fclose(infile);
if(outfile!= stdout)
fclose(outfile);

return 0;
}

/ ************************************ ******************************************* /
/ *节目结束* /
/ ************************************** ***************************************** /






编辑3 - 做出了Jeff提到的更改,我遇到这个问题编译它(在Eclipse中):

 找不到-lC:\Users\tmp\workspace2\jpegManipulator\ lib \libjpeg.a jpeg操纵器C / C ++问题
无效的项目路径:找到重复的路径条目(/ jpegManipulator [Include path] base-path:jpegManipulator isSystemInclude:true includePath:include),path:[/ jpegManipulator]。 jpegManipulator pathentry路径输入问题

我将工作区目录/ lib设置为库源,并且还具有特定的libjpeg。在图书馆选项卡中设置一个库 - 这是绝对的在目录中。



如果我不包括特定的libjpeg.a文件,它会抱怨功能引用缺失,但如果我包含它,它抱怨说那里是没有libjpeg.a被找到。这是用于v9和v6b。

 找不到-lC:\Users\tmp\workspace2\jpeg6bmanip\\ \\ lib /  

解决方案编辑3 问题:https://stackoverflow.com/q/14692302/1666510 之后的新问题。无法运行程序或调试它,因为它声称它无法找到jpeglib.h

解决方案

几年前,我和MinGW一起开发类似的东西。我不得不下载libjpeg的源码并在我的机器上构建它,以获取libjpeg.a文件。来源可以在这里找到:



http:// www。 ijg.org/



当我构建这个库时,我发现的问题是当我执行'nm libjpeg.a'时,显然符号在cdjpeg.h和transupp.h没有被编译到库中。我没有找到办法通过配置,因为我没有看到任何明显的,当我'配置 - 帮助'。而是编辑了Makefile.in文件,它定义了.lo文件的am__objects_1列表。我在最后添加了cdjpeg和transupp,如下所示:

  am__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \\ \\ 
jccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \
jcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \
jcprepct.lo jcsample.lo jctrans.lo jdapimin.lo jdapistd.lo \
jdarith.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \
jddctmgr.lo jdhuff.lo jdinput.lo jdmainct。 lo j b。。b b b b b b b b $ b jidctfst.lo jidctint.lo jquant1.lo jquant2.lo jutils.lo \
jmemmgr.lo cdjpeg.lo transupp.lo @ MEMORYMGR @ .lo

然后我做了一个'make'和'make install',符号出现在库中。在这一点上,我能够得到你的代码来构建。一个自动工具专家可能会想出一个更好的方式来做,但这至少会让你走。


See bottom for updates

I am running into a number of odd problems. For starters, I'm using the latest Eclipse CDT and before implementing do_rot_180, the compiler linked the folder projectName/include but after it now requires specific include/*.h specified below.

Related to that issue, in the project explorer, it seems to think libjpeg.h is missing or invalid despite it being in the folder on the disk.

I am working with libjpeg-9.

Includes (included what transupp.c and example.c included):

Functions (do_rot_180 is from transupp.c and read_JPEG_file is from example.c):

See updated code block below under Edit 2 (pretty much just jpegtran.c code)

This is the rotate function which is unused in jpegtran.c:
//LOCAL(void)
    //do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
    //      JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
    //      jvirt_barray_ptr *src_coef_arrays,
    //      jvirt_barray_ptr *dst_coef_arrays)
    ///* 180 degree rotation is equivalent to
    // *   1. Vertical mirroring;
    // *   2. Horizontal mirroring.
    // * These two steps are merged into a single processing routine.
    // */
    //{
    //  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
    //  JDIMENSION x_crop_blocks, y_crop_blocks;
    //  int ci, i, j, offset_y;
    //  JBLOCKARRAY src_buffer, dst_buffer;
    //  JBLOCKROW src_row_ptr, dst_row_ptr;
    //  JCOEFPTR src_ptr, dst_ptr;
    //  jpeg_component_info *compptr;
    //
    //  MCU_cols = srcinfo->output_width /
    //    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
    //  MCU_rows = srcinfo->output_height /
    //    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
    //
    //  for (ci = 0; ci < dstinfo->num_components; ci++) {
    //    compptr = dstinfo->comp_info + ci;
    //    comp_width = MCU_cols * compptr->h_samp_factor;
    //    comp_height = MCU_rows * compptr->v_samp_factor;
    //    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
    //    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
    //    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
    //   dst_blk_y += compptr->v_samp_factor) {
    //      dst_buffer = (*srcinfo->mem->access_virt_barray)
    //  ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
    //   (JDIMENSION) compptr->v_samp_factor, TRUE);
    //      if (y_crop_blocks + dst_blk_y < comp_height) {
    //  /* Row is within the vertically mirrorable area. */
    //  src_buffer = (*srcinfo->mem->access_virt_barray)
    //    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
    //     comp_height - y_crop_blocks - dst_blk_y -
    //     (JDIMENSION) compptr->v_samp_factor,
    //     (JDIMENSION) compptr->v_samp_factor, FALSE);
    //      } else {
    //  /* Bottom-edge rows are only mirrored horizontally. */
    //  src_buffer = (*srcinfo->mem->access_virt_barray)
    //    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
    //     dst_blk_y + y_crop_blocks,
    //     (JDIMENSION) compptr->v_samp_factor, FALSE);
    //      }
    //      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
    //  dst_row_ptr = dst_buffer[offset_y];
    //  if (y_crop_blocks + dst_blk_y < comp_height) {
    //    /* Row is within the mirrorable area. */
    //    src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
    //    for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
    //      dst_ptr = dst_row_ptr[dst_blk_x];
    //      if (x_crop_blocks + dst_blk_x < comp_width) {
    //        /* Process the blocks that can be mirrored both ways. */
    //        src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
    //        for (i = 0; i < DCTSIZE; i += 2) {
    //      /* For even row, negate every odd column. */
    //      for (j = 0; j < DCTSIZE; j += 2) {
    //        *dst_ptr++ = *src_ptr++;
    //        *dst_ptr++ = - *src_ptr++;
    //      }
    //      /* For odd row, negate every even column. */
    //      for (j = 0; j < DCTSIZE; j += 2) {
    //        *dst_ptr++ = - *src_ptr++;
    //        *dst_ptr++ = *src_ptr++;
    //      }
    //        }
    //      } else {
    //        /* Any remaining right-edge blocks are only mirrored vertically. */
    //        src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];
    //        for (i = 0; i < DCTSIZE; i += 2) {
    //      for (j = 0; j < DCTSIZE; j++)
    //        *dst_ptr++ = *src_ptr++;
    //      for (j = 0; j < DCTSIZE; j++)
    //        *dst_ptr++ = - *src_ptr++;
    //        }
    //      }
    //    }
    //  } else {
    //    /* Remaining rows are just mirrored horizontally. */
    //    src_row_ptr = src_buffer[offset_y];
    //    for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
    //      if (x_crop_blocks + dst_blk_x < comp_width) {
    //        /* Process the blocks that can be mirrored. */
    //        dst_ptr = dst_row_ptr[dst_blk_x];
    //        src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
    //        for (i = 0; i < DCTSIZE2; i += 2) {
    //      *dst_ptr++ = *src_ptr++;
    //      *dst_ptr++ = - *src_ptr++;
    //        }
    //      } else {
    //        /* Any remaining right-edge blocks are only copied. */
    //        jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
    //                dst_row_ptr + dst_blk_x,
    //                (JDIMENSION) 1);
    //      }
    //    }
    //  }
    //      }
    //    }
    //  }
    //}

On top of that, I can't actually find where jcopy_block_row is defined. I've looked through all of the include files and their .c counterparts.

I commented out the error handling stuff in the read_JPEG_file function and want to call do_rot_180 from within but I haven't gotten that far yet.

The only clue I've found is this in transupp.c:

Additional note: jpegtran.exe works separately with the compiled .DLL so it's got to be somewhere.


Edit - copied jpegint.h over into include/ which resolved the include issues.

#ifdef JPEG_INTERNALS
#include "jpegint.h"        /* fetch private declarations */
#include "jerror.h"     /* fetch error codes too */
#endif

Now it's unable to compile even though they all seem to be declared in jpeglib.h or jpegint.h:


Edit 2 - code now contains jpegtran.c stuff for just being able to rotate 180 degrees. Updated code block:

/*********************************************************************************/
/* Defines                                                                       */
/*********************************************************************************/

#define JPEG_INTERNALS

/*********************************************************************************/
/* Includes                                                                      */
/*********************************************************************************/

#include <stdio.h>
#include <iostream>

#include "jinclude.h"
#include "jpeglib.h"
#include "cdjpeg.h"
#include "transupp.h"
#include "jerror.h"

#include <ctype.h>
#include <setjmp.h>

//using namespace std;


static char * infilename;
static char * outfilename;
static JCOPY_OPTION copyoption;
static jpeg_transform_info transformoption;

FILE * infile;
FILE * outfile;


void openFile(char file) {
    if(file == 'i') {
        infile = fopen(infilename, "rb");
    }
    else if(file == 'o') {
        outfile = fopen(outfilename, "wb");
    }
}

/*********************************************************************************/
/* Main Execution Block                                                          */
/*********************************************************************************/

int main() {
    struct jpeg_decompress_struct srcinfo;
    struct jpeg_compress_struct dstinfo;
    struct jpeg_error_mgr jsrcerr, jdsterr;

    jvirt_barray_ptr * src_coef_arrays;
    jvirt_barray_ptr * dst_coef_arrays;
    //int file_index;

    srcinfo.err = jpeg_std_error(&jsrcerr);
    jpeg_create_decompress(&srcinfo);
    dstinfo.err = jpeg_std_error(&jdsterr);
    jpeg_create_compress(&dstinfo);

    jsrcerr.trace_level = jdsterr.trace_level;
    srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;

    //

    outfilename = NULL;
    copyoption = JCOPYOPT_DEFAULT;
    transformoption.transform = JXFORM_NONE;
    transformoption.trim = FALSE;
    transformoption.force_grayscale = FALSE;

    transformoption.transform = JXFORM_ROT_180;

    //

    std::cout << "Enter a filename to rotate 180 degrees." << std::endl;
    std::cin >> infilename;
    openFile('i');
    std::cout << "Enter the output filename." << std::endl;
    std::cin >> outfilename;
    openFile('o');

    //

    jpeg_stdio_src(&srcinfo, infile);
    jcopy_markers_setup(&srcinfo, copyoption);
    (void) jpeg_read_header(&srcinfo, TRUE);

    jtransform_request_workspace(&srcinfo, &transformoption);

    src_coef_arrays = jpeg_read_coefficients(&srcinfo);
    jpeg_copy_critical_parameters(&srcinfo, &dstinfo);

    dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,
                             src_coef_arrays,
                             &transformoption);

    jpeg_stdio_dest(&dstinfo, outfile);
    jpeg_write_coefficients(&dstinfo, dst_coef_arrays);
    jcopy_markers_execute(&srcinfo, &dstinfo, copyoption);

    jtransform_execute_transformation(&srcinfo, &dstinfo,
                        src_coef_arrays,
                        &transformoption);

    jpeg_finish_compress(&dstinfo);
    jpeg_destroy_compress(&dstinfo);
    (void) jpeg_finish_decompress(&srcinfo);
    jpeg_destroy_decompress(&srcinfo);

    //

    if (infile != stdin)
        fclose(infile);
    if (outfile != stdout)
        fclose(outfile);

    return 0;
}

/*********************************************************************************/
/* End of Program                                                                */
/*********************************************************************************/


Edit 3 - Made the changes Jeff mentioned and I am running into this problem when compiling it (in Eclipse):

cannot find -lC:\Users\tmp\workspace2\jpegManipulator\lib\libjpeg.a jpegManipulator         C/C++ Problem
Invalid project path: Duplicate path entries found (/jpegManipulator [Include path] base-path:jpegManipulator isSystemInclude:true includePath:include), path: [/jpegManipulator].jpegManipulator pathentry Path Entry Problem

I have workspace directory /lib set as library source and also the specific libjpeg.a library set in the libraries tab - It is definitely in the directory.

If I don't include the specific libjpeg.a file, it complains about missing function references but if I do include it, it complains saying that there is no libjpeg.a to be found. This is for both v9 and v6b.

cannot find -lC:\Users\tmp\workspace2\jpeg6bmanip\libs\libjpeg.a    jpeg6bmanip         C/C++ Problem
cannot find -lC:\Users\tmp\workspace2\jpeg6bmanip\libs\libjpeg.la   jpeg6bmanip         C/C++ Problem

Solution to Edit 3 problem: https://stackoverflow.com/q/14692302/1666510 but new problem after that. Can't run the program or debug it because it claims it cannot find jpeglib.h.

解决方案

I had something similar happen when developing with MinGW a couple of years ago. I had to download the source for libjpeg and build it on my machine in order to get the libjpeg.a file. The source can be found here:

http://www.ijg.org/

The problem that I found when I built this library was that when I executed 'nm libjpeg.a' it became clear that the symbols in cdjpeg.h and transupp.h were not being compiled into the library. I couldn't find a way to do it via configure since I didn't see anything obvious when I did 'configure --help'. Instead I edited the Makefile.in file where it defines the am__objects_1 list of .lo files. I added cdjpeg and transupp at the end like this:

am__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \
    jccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \
    jcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \
    jcprepct.lo jcsample.lo jctrans.lo jdapimin.lo jdapistd.lo \
    jdarith.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \
    jddctmgr.lo jdhuff.lo jdinput.lo jdmainct.lo jdmarker.lo \
    jdmaster.lo jdmerge.lo jdpostct.lo jdsample.lo jdtrans.lo \
    jerror.lo jfdctflt.lo jfdctfst.lo jfdctint.lo jidctflt.lo \
    jidctfst.lo jidctint.lo jquant1.lo jquant2.lo jutils.lo \
    jmemmgr.lo cdjpeg.lo transupp.lo @MEMORYMGR@.lo

Then I did a 'make' and a 'make install' and the symbols were present in the library. At that point I was able to get your code to build. An autotools expert may be able to come up with a better way to do it but this will at least get you going.

这篇关于需要帮助从libjpeg编译jpegtran.c代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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