在Windows for Eclipse中编译/使用libjpeg

在Windows for Eclipse中编译/使用libjpeg,eclipse,dll,mingw,libjpeg,Eclipse,Dll,Mingw,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: confli

此问题/答案最终将作为此问题的完整答案:因为只有在您已经完成了以下所有操作的情况下,该问题的答案才有用

我跟随导游来到这里: (使用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的作用相同

做出本问题中所述的变更后:

将以下定义添加到jconfig.h

\define HAVE\u原型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项目中,并链接了库和include路径:

我不确定这是否适合我想如何使用它,但它确实有用,而且可以编译。下一部分:从DLL中调用函数

与使用已编译的jpegtran.exe相关:

尝试在单独的项目中使用库和编译:


当前问题:

< P>更新JCOFIG.h文件到<代码> >定义HaveI原型1 <代码>只是一个更深层次的问题的创可贴解决方案:JCONFIG.H已经损坏,并且对于编译器支持的许多重要项目来说,代码不正确。 解决这个问题的正确方法是按照install.txt的建议手动编译ckconfig.c并让它为您生成一个jconfig.h,然后继续进行make和make install