add jpeg toolbox in matlab 2014a

6 views (last 30 days)
negar zamani
negar zamani on 29 Jul 2019
Commented: Venus R on 19 Nov 2020
hi.please help me to correct these errors.
os :win7 x64
matlab 2014a
>> mex -setup
MEX configured to use 'Microsoft Visual C++ 2010 Professional (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
To choose a different C compiler, select one from the following:
lcc-win32 mex -setup:'C:\Program Files (x86)\MATLAB\R2014a\bin\win32\mexopts\lcc-win32.xml' C
Microsoft Visual C++ 2010 Professional (C) mex -setup:C:\Users\#NeGaR\AppData\Roaming\MathWorks\MATLAB\R2014a\mex_C_win32.xml C
Microsoft Windows SDK 7.1 (C) mex -setup:'C:\Program Files (x86)\MATLAB\R2014a\bin\win32\mexopts\winsdk-7.1_c.xml' C
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
>> mex -I'C:\Program Files (x86)\MATLAB\R2014a\bin\jpegprj' jpeg_write.c 'C:\Program Files (x86)\MATLAB\R2014a\bin\jpegprj\libjpeg.lib'
Building with 'Microsoft Visual C++ 2010 Professional (C)'.
Error using mex
Creating library jpeg_write.lib and object jpeg_write.exp
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_finish_compress referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_write_marker referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_alloc_huff_table referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_alloc_quant_table referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_write_coefficients referenced
in function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jround_up referenced in function
_mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_simple_progression referenced
in function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_set_defaults referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_stdio_dest referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_CreateCompress referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_destroy_compress referenced in
function _mexFunction
jpeg_write.obj : error LNK2019: unresolved external symbol _jpeg_std_error referenced in
function _mexFunction
jpeg_write.mexw32 : fatal error LNK1120: 12 unresolved externals
>> mex -I'C:\Program Files (x86)\MATLAB\R2014a\bin\jpegprj' jpeg_read.c 'C:\Program Files (x86)\MATLAB\R2014a\bin\jpegprj\libjpeg.lib'
Building with 'Microsoft Visual C++ 2010 Professional (C)'.
Error using mex
Creating library jpeg_read.lib and object jpeg_read.exp
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_finish_decompress referenced
in function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_read_coefficients referenced
in function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_read_header referenced in
function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_save_markers referenced in
function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_stdio_src referenced in
function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_CreateDecompress referenced in
function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_destroy_decompress referenced
in function _mexFunction
jpeg_read.obj : error LNK2019: unresolved external symbol _jpeg_std_error referenced in
function _mexFunction
jpeg_read.mexw32 : fatal error LNK1120: 8 unresolved externals
>>
  1 Comment
Steven Lord
Steven Lord on 18 Nov 2019
I'm coming to this a bit late, but is there a reason you're not just using the imwrite function included in MATLAB? I checked the documentation in release R2014a and it can write JPEG files (either "8-bit, 12-bit, and 16-bit Baseline JPEG images" or "1-bit, 8-bit, and 16-bit JPEG 2000 images" depending on the fmt input you pass into imwrite.)

Sign in to comment.

Answers (2)

Guillaume
Guillaume on 29 Jul 2019
I know nothing about that toolbox but all these missing symbols looks like symbols from libjpeg. I assume it's a dependency of that toolbox, perhaps the 404 file from step 2. So, have you done that step 2? If you've skipped step 2 or 3, it's no suprise that the installation doesn't work.
Note: libjpeg can be downloaded from a number of places, including sourceforge.
  15 Comments
Royi Avital
Royi Avital on 18 Nov 2019
Does anyone knows which JPEG library MATLAB uses?
Walter Roberson
Walter Roberson on 18 Nov 2019
MATLAB uses a number of different jpeg related libraries (for reasons that are not clear.)
On Mac, the most obvious libraries it uses are version 0.0.0.0 (which is to say no version has been assigned.) Those are probably Mathworks library.
/Applications/MATLAB_R2019b.app/sys/java/jre/maci64/jre/lib/libjpeg.dylib is marked as version 1.0.0.0

Sign in to comment.


negar zamani
negar zamani on 3 Aug 2019
Edited: negar zamani on 3 Aug 2019
see pics please. i did convert ' to " in jpeg_read.m and jpeg_write.m
in 2014a but errors didn't refine.
  9 Comments
negar zamani
negar zamani on 8 Aug 2019
stg.jpg or every jpg filename that use in jpeg_write create in directory as same as directory that run the program(.m file) . it is necessary to create .m file in same directory by toolbox directory.
i changed the directory of my program and tried again.
no change. The error is exist yet
Venus R
Venus R on 19 Nov 2020
hi negar
did you solve your "Error writing to file" error?
can you tell me how?

Sign in to comment.

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!