Visual Studio 2010 and MAT-Files

조회 수: 3 (최근 30일)
Alex
Alex 2011년 3월 10일
I am trying to build a stand-alone application what will build a mat file with some input file data. I am currently working on using Visual C++ and compile with Visual Studio 2010. I have followed several tutorials on building against library files to no avail; I always see the error: "error LNK2019: unresolved external symbol _matClose referenced in function _wmain" .
I have set the path (C:\Program Files\MATLAB\R2010b\extern\lib\win64\microsoft) to the lib files in Configuration Properties > Linker > General > Additional Library Directories
I have set the library file names (libmat.lib, libmx.lib) in Configuration Properties > Linker > Input > Additional Dependencies
I have set the include file path (C:\Program Files\MATLAB\R2010b\extern\include) in Configuration Properties > C/C++ > General > Additional Include Directories
I don't see any error about not being able to find the .lib file, but I see one if I alter one of the .lib files names to a file that does not exists. I am fairly certain the lib files are being found at compile time. The header files also seem to be set up correctly.
I don't have any ideas left in this noggin so if ANYONE has ANY idea I would really appreciate it.
If I am trying to do something that isn't possible, please let me know so I don't spin my wheels any longer. If I am missing a step somewhere in the chain, I would really appreciate that info, as well.
Environment: -Windows 7 64 bit -Visual Studio 2010 Pro -MATLAB R2010b

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 3월 11일
편집: Kaustubha Govind 2013년 9월 9일
Have you tried the example in the documentation to verify whether you are setting all compiler and linker options correctly? If you compile with the -v option, you should see the exact compile/linker commands that are used.
Compare these with the commands that Visual Studio uses (I believe they are displayed in the bottom panel during compilation).
Also, do you see linker errors only for _matClose? I'm surprised that it can resolve the other symbols like matOpen, matPutVariable, etc.
  댓글 수: 3
Ragaar Ashnod
Ragaar Ashnod 2013년 9월 9일
The provided url is broken as of 9/9/2013.
Kaustubha Govind
Kaustubha Govind 2013년 9월 9일
Sorry about that! Fixed the link.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by