为什么在os X上构建libjpeg时出现“enable-shared失败”?

3 投票
1 回答
985 浏览
提问于 2025-04-15 14:13

我正在尝试在OS X上安装libjpeg,以解决Python图像库在处理JPEG时遇到的问题。

我从http://www.ijg.org/files/jpegsrc.v7.tar.gz下载了libjpeg。

然后,我开始设置配置文件。

cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .
./configure –enable-shared

但是,enable-shared这个选项似乎没有起作用。

$ ./configure –-enable-shared
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: –-enable-shared
checking build system type... Invalid configuration `–-enable-shared': machine `–-enable' not recognized
configure: error: /bin/sh ./config.sub –-enable-shared failed

我在网上搜索了很多,但还是搞不清楚错误出在哪里,或者该如何解决这个问题。

1 个回答

3

我从一个博客上复制了代码。

里面的那个标志字符看起来像是一个连字符,其实并不是:

ord("–")

TypeError: ord() expected a character, but string of length 3 found

我把它改成了一个正确的连字符,现在运行得很好。

撰写回答