mex file creation from 32 to 64 bits

3 views (last 30 days)
Stephen Yip
Stephen Yip on 17 Sep 2012
Hi,
The mex files (mexw32) can be created smoothly on a 32bit machine. But I failed to create the same mex files on a 64 bit one. I should have all the relevant files or else it wouldn't work on a 32 bit machine.
Does anyone know if the obj or c files need to be edited differently for a 64 bits machine?
More specifically, I keep getting the following error.
affine_transform_3d_double.obj : error LNK2019: unresolved external symbol interpolate_3d_double_gray referenced in function transformvolume affine_transform_3d_double.mexw64 : fatal error LNK1120: 1 unresolved externals
C:\PROGRA~1\MATLAB\R2011B\BIN\MEX.PL: Error: Link of 'affine_transform_3d_double.mexw64' failed.
Thanks!! Stephen

Answers (2)

Kaustubha Govind
Kaustubha Govind on 17 Sep 2012
You do need to have all object/library files that you are linking against to also be of 64-bit architecture, so you need to re-compile them if you only have 32-bit versions.

Stephen Yip
Stephen Yip on 17 Sep 2012
I am not familiar with c....is there no simple way to covert 32 bit code into 64 nit architecture?
Thanks!
  3 Comments
Walter Roberson
Walter Roberson on 17 Sep 2012
Though it depends on what the C does and has it is written. Some C code would simply need to be recompiled. Some would need to have some data types changed to avoid using more space than originally expected. Some code that interacted with the operating system would need to have minor changes to names of the routines that are called. But there are some kinds of code that need extensive changes.
Jan
Jan on 18 Sep 2012
Edited: Jan on 18 Sep 2012
I assume James meant that a mexw32 cannot be converted to a mexw64 file, while Walter explains, that a C-source, which compiles successfully for a 32-bit compiler need sometimes modifications to work with a 64-bit compiler also.
I confirm both. There is no simple way to convert C-code and no way at all to convert compiled libraries.

Sign in to comment.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!