mex file creation from 32 to 64 bits

조회 수: 10 (최근 30일)
Stephen Yip
Stephen Yip 2012년 9월 17일
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

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2012년 9월 17일
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 2012년 9월 17일
I am not familiar with c....is there no simple way to covert 32 bit code into 64 nit architecture?
Thanks!
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 9월 17일
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 2012년 9월 18일
편집: Jan 2012년 9월 18일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by