f



linking matlab dll file to C code in Visual Studio

I have a diffculty trying to follow an example of a recent Webinar on
"Matlab for C/C++ Programmers". One of the example as "Build
Component example", where a simple m code (foo.m) was converted to a
dll (foolib.dll) that is to be called by a C-program. A dll file was
successfully generated (by invoking 'mcc -t -W libhg:foolib -T
link:lib -h libmmfile.mlib libmwsglm.mlib foo.m'). Then when I
cimpile and link the client C code in MS Visual Studio, Link errors
occur. The messages are something like, ('main.obj : error LNK2001:
 unresolved external symbol _mclGetPi'). I added include and library
files to the projects. Compiling and linking was successfully done
upto this exercise. Anyone can help identifying what seems to be the
problem. I suspect the linker might not be finding the dll file... I
placed it in various locations, such as in foo directory...
0
ypark (9)
12/7/2004 2:10:29 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
772 Views

Similar Articles

[PageSpeed] 11

Hi,

You may have some solutions in our MATLAB C/C++ Book (at
www.LePhanPublishing.com).

LePhan,

Young Park wrote:
>
>
> I have a diffculty trying to follow an example of a recent Webinar
> on
> "Matlab for C/C++ Programmers". One of the example as "Build
> Component example", where a simple m code (foo.m) was converted to
> a
> dll (foolib.dll) that is to be called by a C-program. A dll file
> was
> successfully generated (by invoking 'mcc -t -W libhg:foolib -T
> link:lib -h libmmfile.mlib libmwsglm.mlib foo.m'). Then when I
> cimpile and link the client C code in MS Visual Studio, Link errors
> occur. The messages are something like, ('main.obj : error LNK2001:
>
> unresolved external symbol _mclGetPi'). I added include and
> library
> files to the projects. Compiling and linking was successfully done
> upto this exercise. Anyone can help identifying what seems to be
> the
> problem. I suspect the linker might not be finding the dll file...
> I
> placed it in various locations, such as in foo directory...
0
LePhan (62)
12/7/2004 7:41:52 PM
Reply: