f



Calling matlab from C/C++

SUBJECT : Using matlab Engine. (Or Calling matlab from C).

  I have a problem in Calling matlab from C. Did any body used it
before.

I'm getting problem while Linking at Runtime.(During Build.. not
while compiling).

It Shows The Following Error Message. Error LNK2001 unresolved
External Symbol.

Even I couldn't Run the example program given by matlab.

I tried engdemo.c and engwindemo.c given in
$matlab/extern/examples/eng_mat/

I will truely, apprieciate all your help in this regard.

Thanks,
Kiran Chintal.
0
kchintal (11)
7/28/2004 3:56:07 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

5 Replies
825 Views

Similar Articles

[PageSpeed] 55

hello,

which compiler do you use?
I tried BloodShed, and it didn't
compile well.
with visual c++ it has been okay.

the example (engwindemo.c) do work

vincent
0
7/29/2004 6:21:05 AM
Hi Vincentd,

I used MS Visual C++ 6.0. & Matlab compiler 4.0.

Now Its creating an .exe.

But after running, the exe in command line. I'm unable to see any
results get displayed.

I'm following doing the following Steps.

1) mcc -m first.m (to create c files)
2) mcc -l first.m (to create library files).

Also, Selected Compiler thru.
C:> mbuild -setup
I have selected MS Visual C++

Now its createding .exe

=> buildmcr
to create MCRInstaller.exe ,.zip for deploying into other machines.

I'm not sure are there any steps I'm missing?. So that I can
interface with my C Code and pass some data to matlab.

Once again, Thank you for your reply.

Thanking you,
Kiran.

vincentd wrote:
>
>
> hello,
>
> which compiler do you use?
> I tried BloodShed, and it didn't
> compile well.
> with visual c++ it has been okay.
>
> the example (engwindemo.c) do work
>
> vincent
0
kchintal (11)
7/29/2004 3:05:12 PM
Also trying,

mcc -m engwindemo.c (after selecting the compiler using mbuild -setup
and selecting MS Visual C++ 6.0).

It failed, giving LNK2001 linker error unresolved external symbol.

I will truely, apprieciate all your help in this regard.

Thanks,
-Kiran.
0
kchintal (11)
7/29/2004 3:26:54 PM
hello Kiran,

maybe you might (in a first step, just to see
if it works on your computer) do this:

build a project in msvisual c++ with
engwindemo.c , engine.h, matrix.h and the libs

(I mean don't use mcc)

The exe produced should work

If you need more info tell me
vincent

kiran wrote:
>
>
> Also trying,
>
> mcc -m engwindemo.c (after selecting the compiler using mbuild
> -setup
> and selecting MS Visual C++ 6.0).
>
> It failed, giving LNK2001 linker error unresolved external symbol.
>
> I will truely, apprieciate all your help in this regard.
>
> Thanks,
> -Kiran.
0
demolomb (4)
7/30/2004 9:52:25 AM
Thanks Vincent,

After Adding libeng.lib,libmx,lib,libut.lib
It worked fine.

Thanks a lot,
Kiran.

vincent demolombe wrote:
>
>
> hello Kiran,
>
> maybe you might (in a first step, just to see
> if it works on your computer) do this:
>
> build a project in msvisual c++ with
> engwindemo.c , engine.h, matrix.h and the libs
>
> (I mean don't use mcc)
>
> The exe produced should work
>
> If you need more info tell me
> vincent
>
> kiran wrote:
>>
>>
>> Also trying,
>>
>> mcc -m engwindemo.c (after selecting the compiler using mbuild
>> -setup
>> and selecting MS Visual C++ 6.0).
>>
>> It failed, giving LNK2001 linker error unresolved external
> symbol.
>>
>> I will truely, apprieciate all your help in this regard.
>>
>> Thanks,
>> -Kiran.
0
kchintal (11)
7/30/2004 8:56:44 PM
Reply: