【问题标题】:Compiling/using libjpeg in Windows for Eclipse在 Windows 中为 Eclipse 编译/使用 libjpeg
【发布时间】:2013-01-29 22:54:37
【问题描述】:

此问题/答案最终将作为此问题的完整答案:How can I manipulate/rotate a JPEG image in C++? 因为该问题的答案只有在您已完成以下所有操作时才有用。

我按照这里的指南进行操作:Compiling libjpeg (使用 MINGW32 Shell 的公认答案指南)

尽管下载了新副本,但它仍然无法工作:

$ make
make  all-am
make[1]: Entering directory `/c/tmp/jpeg-9'
  CC       jaricom.lo
  CC       jcapimin.lo
jcapimin.c:127:1: error: conflicting types for 'jpeg_suppress_tables'
jcapimin.c:128:1: note: an argument type that has a default promotion can't matc
h an empty parameter name list declaration
In file included from jcapimin.c:22:0:
jpeglib.h:997:14: note: previous declaration of 'jpeg_suppress_tables' was here
make[1]: *** [jcapimin.lo] Error 1
make[1]: Leaving directory `/c/tmp/jpeg-9'
make: *** [all] Error 2

8d 和 9 都做同样的事情。

在此问题中注明更改后:Compile libjpeg with mingw

将以下定义添加到 jconfig.h

#define HAVE_PROTOTYPES 1

我在制作时得到这个输出:

$ make
make  all-am
make[1]: Entering directory `/c/tmp/jpeg-9'
  CC       jaricom.lo
In file included from jinclude.h:20:0,
                 from jaricom.c:17:
jconfig.h:5:24: warning: extra tokens at end of #undef directive [enabled by def
ault]
  CC       jcapimin.lo
In file included from jinclude.h:20:0,
                 from jcapimin.c:21:
jconfig.h:5:24: warning: extra tokens at end of #undef directive [enabled by def
ault]
jcapimin.c:127:1: error: conflicting types for 'jpeg_suppress_tables'
jcapimin.c:128:1: note: an argument type that has a default promotion can't matc
h an empty parameter name list declaration
In file included from jcapimin.c:22:0:
jpeglib.h:997:14: note: previous declaration of 'jpeg_suppress_tables' was here
make[1]: *** [jcapimin.lo] Error 1
make[1]: Leaving directory `/c/tmp/jpeg-9'
make: *** [all] Error 2

然后你必须运行“autoheader”来解决这个问题并重新制作。

它应该是成功的,但我的构建目录中没有任何内容,由 ./configure --prefix=/c/tmp/jpeg-9-build/ 设置

我在项目目录的 .lib 文件夹中找到了 libjpeg-9.dll。

凌乱..现在的问题是:如何在 Eclipse 中使用它?

我在主目录中有 exe,在 .lib 子目录中有一些 exe 和 DLL,但没有 .lib 文件 - 如何将这些导入到 Eclipse 项目中,以便我可以调用 DLL 中的函数?

$ make install 收集构建目录中的文件。

我将构建目录的内容迁移到工作的 Eclipse 项目中,并链接了库和包含路径:

我不确定这是否适合我想要使用它的方式,但它确实可以编译。下一部分:从 DLL 中调用函数?

使用编译好的jpegtran.exe相关:jpegtran.exe not correctly rotating image

尝试使用库并在单独的项目中编译:Need help compiling jpegtran.c code from libjpeg

当前问题:Need help compiling jpegtran.c code from libjpeg

【问题讨论】:

    标签: eclipse dll mingw libjpeg


    【解决方案1】:

    您关于将 jconfig.h 文件更新为 #define HAVE_PROTOTYPES 1 的建议只是针对更深层次问题的临时解决方案:jconfig.h 已损坏,并且对于您的编译器支持的许多重要项目,#undef 不正确。

    解决此问题的正确方法是按照 install.txt 的建议手动编译 ckconfig.c 并让它为您生成一个 jconfig.h,然后继续进行 make 和 make install。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-19
      • 1970-01-01
      • 2012-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多