mex file creation from 32 to 64 bits

4 Ansichten (letzte 30 Tage)
Stephen Yip
Stephen Yip am 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

Antworten (2)

Kaustubha Govind
Kaustubha Govind am 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 am 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 Kommentare
Walter Roberson
Walter Roberson am 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 am 18 Sep. 2012
Bearbeitet: Jan am 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by