为MATLAB编译jpeg_read.c作为mexmaci64 [英] Compile jpeg_read.c as mexmaci64 for MATLAB
问题描述
我从下载了MATLAB的jpeg_toolbox此站点,然后从此处下载JPEG编译器工具.我按照说明在Mac(UNIX *)上进行了整体配置.
I downloaded the jpeg_toolbox for MATLAB from this site, then downloaded the JPEG compiler tools from here. I followed the instruction to configure the whole for Mac (UNIX*).
现在,我将需要编译包含在MATLAB的第一个链接中的jpeg_read.c
和jpeg_write.c
,因为该工具箱不提供mexmaci64文件.但是,当我尝试:
Now, I would need to compile the jpeg_read.c
and jpeg_write.c
contained into the first link for MATLAB, because the toolbox does not provide the mexmaci64 files. However when I try to:
mex jpeg_read.c
MATLAB返回以下错误:
MATLAB returns the following error:
Error using mex
Undefined symbols for architecture x86_64:
"_jpeg_CreateDecompress", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_destroy_decompress", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_finish_decompress", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_read_coefficients", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_read_header", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_save_markers", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_std_error", referenced from:
_mexFunction in jpeg_read.o
"_jpeg_stdio_src", referenced from:
_mexFunction in jpeg_read.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如何编译程序?否则,你们中有人已经得到了我需要的mexmaci64吗?
How can I compile the program? Otherwise, does any of you have already got the mexmaci64 I would need?
推荐答案
我这样解决:
brew install libjpeg
我在/usr/local/lib
中找到了库,因此在MATLAB上,我移到了包含必须编译的.c
文件的文件夹,然后运行了:
I found the libraries in /usr/local/lib
so on MATLAB I moved into the folder that contained the .c
files that had to be compiled and I ran:
mex jpeg_read.c "/usr/local/lib/libjpeg.a"
mex jpeg_write.c "/usr/local/lib/libjpeg.a"
这篇关于为MATLAB编译jpeg_read.c作为mexmaci64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!