f



problem with creating mat files from C++ (visual studio 2005)

Hi,

I am having trouble creating mat files from my visual studio 2005
express. For example, the
matcreat.c file that is given as an example in the mathworks site,
produced 13 linking errors of this type:

1>Linking...
1>matcreat.obj : error LNK2019: unresolved external symbol _mxGetString
referenced in function _main
(...)

this happened although I set up the VC++ directories for include files
and libraries to point to the matlab\extern\include and
matlab\extern\lib\ respectively.

Any help will be greatly appreciated. Thank you
ilias

PS. Some secondary questions I have:
(a) mex -setup "sees" only the lcc compiler and not the msvc as it
should from visual studio 2005. I did add the cl.exe path to the
environmental variable path but the result is the same. I recently
installed the 9.1 intel compiler, same problem.
(b)If you have played with vms isual c++ 2005, there is supposed to be
a "compile tab" in the solution manager. Any thoughts why there is not
in mine ?

0
iliast (9)
6/10/2006 6:39:37 AM
comp.soft-sys.matlab 210207 articles. 11 followers. lunamoonmoon (258) is leader. Post Follow

2 Replies
531 Views

Similar Articles

[PageSpeed] 36

This is not a problem associated with "mat files" exactly. You're obviously 
using some library routines from somewhere and have not included them 
correctly in your project.

So the question is: What library are you using, and how are you including it 
in your project?

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"ilias" <iliast@gmail.com> wrote in message 
news:1149921577.837903.252670@h76g2000cwa.googlegroups.com...
> Hi,
>
> I am having trouble creating mat files from my visual studio 2005
> express. For example, the
> matcreat.c file that is given as an example in the mathworks site,
> produced 13 linking errors of this type:
>
> 1>Linking...
> 1>matcreat.obj : error LNK2019: unresolved external symbol _mxGetString
> referenced in function _main
> (...)
>
> this happened although I set up the VC++ directories for include files
> and libraries to point to the matlab\extern\include and
> matlab\extern\lib\ respectively.
>
> Any help will be greatly appreciated. Thank you
> ilias
>
> PS. Some secondary questions I have:
> (a) mex -setup "sees" only the lcc compiler and not the msvc as it
> should from visual studio 2005. I did add the cl.exe path to the
> environmental variable path but the result is the same. I recently
> installed the 9.1 intel compiler, same problem.
> (b)If you have played with vms isual c++ 2005, there is supposed to be
> a "compile tab" in the solution manager. Any thoughts why there is not
> in mine ?
> 


0
jwood (6)
6/10/2006 5:54:33 PM
Thanks for your reply. Including these two libraries , solves the
problem.

#pragma comment(lib, "libmat.lib")
#pragma comment(lib, "libmx.lib")

Does anyone have an answer to the other two questions, namely why mex
-setup can't see the msvc compiler and why there is no compile tab in
the solution explorer?

Thanks !
ilias

0
iliast (9)
6/10/2006 6:45:31 PM
Reply: