MATLAB-从jpeg_write.c创建maxmaci64时出错 [英] MATLAB - Error creating maxmaci64 from jpeg_write.c

查看:63
本文介绍了MATLAB-从jpeg_write.c创建maxmaci64时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用jpeg工具箱中的jpeg_read.c和jpeg_write.c的Mex制作mexmaci64文件时遇到问题.我在此处提出了问题为jpeg_read解决.但是当我编译jpeg_write.c时,我仍然有一个不同的错误.一切都是一样的,我没有改变任何路径或任何东西.我不明白为什么Matlab控制台会返回此错误.任何人都熟悉吗?请让我知道.

I had problems making mexmaci64 files using Mex from both jpeg_read.c and jpeg_write.c from jpeg toolbox. I asked my question here and the problem for jpeg_read solved. but I still have a different error when I compile jpeg_write.c. everything is the same and I didn't change any path or anything. I don't understand why Matlab console returns this error. Is this familiar to anybody? please let me know.

>> mex -compatibleArrayDims -I/usr/local/Cellar/jpeg/9d/include jpeg_write.c -L/usr/local/Cellar/jpeg/9d/lib -ljpeg
Building with 'Xcode with Clang'.
Error using mex
/Users/folder/jpeg_toolbox/jpeg_write.c:56:10: fatal error: 'jpegint.h' file not found
#include <jpegint.h>
         ^~~~~~~~~~~
1 error generated.

推荐答案

首先:

通过指向 jpeg 或其他库的/usr/local/Cellar/jpeg/< version>/include 位置,您将依赖于当前安装的特定版本.您可能想使用/usr/local/opt/jpeg/include/等./usr/local/opt 是Homebrew公开其已安装软件包内容的非版本表示的地方.

By pointing at the /usr/local/Cellar/jpeg/<version>/include location of the jpeg or other libraries, you're dependent on the specific version that is currently installed. You probably want to use /usr/local/opt/jpeg/include/ etc instead. /usr/local/opt is where Homebrew exposes its non-versioned presentations of its installed package contents.

所以:

mex -compatibleArrayDims -I/usr/local/Cellar/jpeg/9d/include ...

这指向 jpeg 库. jpeg 库是否提供 jpegint.h ?

This is pointing at the jpeg library. Does the jpeg library supply jpegint.h?

$ ls /usr/local/Cellar/jpeg/9d/include/
jconfig.h  jerror.h  jmorecfg.h  jpeglib.h

不.所以这就是为什么找不到它的原因.因此,您必须弄清楚从哪里可以真正获得 jpegint.h .点击Google并查阅您的文档,以了解您实际上是在尝试从哪个库中提取 jpegint.h ,并使用相应的 -I 将该库引入, -L -l <​​/code>标志.

Nope. So that's why it's not found. So you have to figure out where you can actually get jpegint.h from. Hit Google and consult your documentation to figure out what library you're actually trying to pull jpegint.h from, and pull that in, too, with the appropriate -I, -L, and -l flags.

如果认为已经安装了它,则可以使用 find/usr/local/Cellar -name jpegint.h 查找它.我在 gdcm 包中找到了它.

If you think you have it already installed, you can use find /usr/local/Cellar -name jpegint.h to look for it. I found it in the gdcm package.

[~] $ find /usr/local/Cellar -name jpegint.h
/usr/local/Cellar/gdcm/3.0.8_1/include/gdcm-3.0/gdcmjpeg/jpegint.h

所以您可能想要类似的东西:

So you probably want something like:

mex -compatibleArrayDims -I/usr/local/opt/jpeg/include ...
    -I/usr/local/opt/gdcm/include/gdcm-3.0/gdcmjpeg ...
    jpeg_write.c ...
    -L/usr/local/opt/jpeg/lib -L/usr/local/opt/gdcm/lib ...
    -ljpeg -lgdcmjpeg16

(我不知道您是否真正想要 -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 ,或者其他一些东西.我我只是在这里猜测.请查阅GDCM文档.)

(I don't know if you actually want -lgdcmjpeg8, -lgdcmjpeg12, or -lgdcmjpeg16, or maybe something else. I'm just guessing here. Consult the GDCM documentation.)

这篇关于MATLAB-从jpeg_write.c创建maxmaci64时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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