From: Robert on
> Assuming the compiler has a switch to _generate_ 32-bit code as well as
> 64, chances are at least reasonable.

Yes, of course, just using 32bit libraries isn't enough, duh. I don't know what I was thinking. I'll look for a 32bit flag.

The strange thing is that I can compile C files with mex just fine.
From: Robert on
Thanks to the help from this page, I'm no longer getting "file is not of required architecture" errors. I added the flag -m32.

However, when I try to compile a sample program (see http://www.eece.maine.edu/mm/MM6/mm6files/timestwo.f ) I get the following errors:

----------
>> mex timestwo.f
Undefined symbols:
"_mxcopyptrtoreal8_", referenced from:
_mexfunction_ in timestwo.o
"_mxgetm_", referenced from:
_mexfunction_ in timestwo.o
"_mxgetn_", referenced from:
_mexfunction_ in timestwo.o
"_mxcopyreal8toptr_", referenced from:
_mexfunction_ in timestwo.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

mex: link of ' "timestwo.mexmaci"' failed.
----------

Do I need to configure the linker somehow? Why isn't Matlab finding these native functions?

Any advice?