dll – 配置脚本不启用make来生成共享库

这与编译libjpeg v6b有关,如果相关的话.

我运行./configure –prefix = / c / tmp / jpeg-6b-build –enable-shared –enable-static就像安装doc说的那样,但是libtool没有它.

checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes

我想我需要这个共享库才能编译一些函数. libjpeg本身编译得很好,而.exe它会生成工作但我需要使用其他东西. v6b在某些情况下不会生成.DLL而v9会生成.DLL.

./configure命令的完整输出:

ild
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline... __inline__
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... yes
checking for a BSD compatible install... /bin/install -c
checking for ranlib... ranlib
checking host system type... i386-pc-mingw32
checking for ranlib... ranlib
checking for gcc... gcc
checking whether we are using GNU C... yes
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... no
checking if gcc static flag -static works... -static
checking whether ln -s works... no
checking for ld used by GCC... ./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../
../mingw32/bin/ld.exe
checking if the linker (./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../ming
w32/bin/ld.exe) is GNU ld... yes
checking whether the linker (./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../..
/mingw32/bin/ld.exe) supports shared libraries... yes
checking for BSD-compatible nm... /mingw/bin/nm
checking command to parse /mingw/bin/nm output... no
checking how to hardcode library paths into programs... immediate
checking for ./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.
exe option to reload object files... -r
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged

相关问题:Need help compiling jpegtran.c code from libjpeg

解决方法

我遇到了同样的问题,我相信这是因为jpeg-6b是用非常旧版本的autotools构建的(如果sourceforge页面正确的话,jpeg-6b版本可追溯到1998年).

特别是,问题是它检查gcc是否支持-fPIC标志的方式:

checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... no

这就是他们从config.log执行检查的方式:

ltconfig:547: checking if gcc PIC flag -fPIC works
ltconfig:548: gcc -c  -fPIC -DPIC -I/local/include conftest.c 1>&5
conftest.c:1:0: warning: -fPIC ignored for target (all code is position independent)

 ^

注意gcc如何返回警告,它可能返回退出代码1,这使得检查失败.并且位置无关的代码对于共享库是必需的,因此这使得它认为它无法生成它们,并且它稍后输出:

checking whether to build shared libraries... no

与libjpeg9相比,我假设使用了更新的autotools版本:

checking for gcc -std=gnu99 option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works... yes

从config.log:

configure:10108: checking for gcc -std=gnu99 option to produce PIC
configure:10115: result: -DDLL_EXPORT -DPIC
configure:10123: checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works
configure:10141: gcc -std=gnu99 -c -g -O2 -I/local/include -DDLL_EXPORT -DPIC -DPIC conftest.c >&5
configure:10145: $? = 0
configure:10158: result: yes

我最终编译了libjpeg9,但我认为如果你可以使用更新版本的autotools重新创建./configure脚本,libjpeg6也可能是可编译的.

相关文章

文章浏览阅读2.2k次,点赞6次,收藏20次。在我们平时办公工作...
文章浏览阅读1k次。解决 Windows make command not found 和...
文章浏览阅读3.2k次,点赞2次,收藏6次。2、鼠标依次点击“计...
文章浏览阅读1.3w次。蓝光版属于高清版的一种。BD英文全名是...
文章浏览阅读974次,点赞7次,收藏8次。提供了更强大的功能,...
文章浏览阅读1.4w次,点赞5次,收藏22次。如果使用iterator的...