From: "Nicolai Brejnholt" <nicolai_f_b@hotmail.com>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: Problems linking MEX'ed object files.
Message-ID: <ef55661.-1@webcrossing.raydaftYaTP>
Date: Mon, 30 Apr 2007 05:36:27 -0400
Lines: 34
NNTP-Posting-Host: 85.218.132.197
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:406006



Hello
First of all, should mention that I'm using MATLAB 6.5 release 13.
I'm trying to MEX some C-code. For this purpose, I've written the
proper interface. I found out early on, that the lcc C version 2.4
included with MATLAB 6.5, was outdated for my purpose. Therefore I
switched to MCSV6.0 (and also installed Watcom 10.6). If I use the -c
(compile only) option, I can compile my code fine to .obj's. IF I try
to link it however, I get this:

Warning: Ignoring invalid option
'LIBPATH:"C:\MATLAB6p5\extern\lib\win32\microsoft\msvc60"
Warning: Cannot locate 'libmx.lib'; skipping -- fuzzy name matching
may not work
Warning: Cannot extract external symbols from 'libmx.lib' -- fuzzy
linking may not work
----same warning repeats for the 3 other files needed (libmex.lib,
libmatlb.lib and libmat.lib)----
Warning! EW1008: cannot open libmx.lib : No such file or directory
----same warning repeats for the 3 other files needed----
Error! E2028: mxGetNumberofElements_ is an undefined reference
----same error repeats for the other mx-types I use----

It doesn't take a genius to see what happens, but why? The needed
files ARE located in the LIBPATH path, so why does it "ignore invalid
option"?

Also, if I try to use Watcom to link it, I get the same problem
(albeit in less details. It just tells me, that the references are
undefined).

And while we are at it. It also fails to include a .lib file, that I
added to my compilation. I've tried adding it after my .c-files
simply as libname.lib and also tried adding it, when simply linking
the objects. Doesn't use it.