How to read the .mat file in visual studio 2019 (C)?

26 ビュー (過去 30 日間)
보은 이
보은 이 2022 年 9 月 16 日
回答済み: Pratik Pawar 2022 年 10 月 3 日
I want to read the .mat file in visual studio.
That is my code and error.
How can I solve this problem?
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <mat.h>
#include <matrix.h>
//#pragma comment(lib, "libmx.lib")
//#pragma comment(lib, "libmat.lib")
int main()
{
MATFile* pmat;
const char* file = "ais_data20220716.mat";
pmat = matOpen(file, "r");
int ship_number = 31;
return 0;
}
%-----------------------------------------error------------------------------
[in Korean]
error LNK2019: _matOpen_800_main 함수에서 참조되는 확인할 수 없는 외부 기호
fatal error LNK1120: 1개의 확인할 수 없는 외부 참조입니다.
[in English]
error LNK2019: unresolved external symbol referenced in function _matOpen_800_main
error LNK1120: 1 unresolved externals.

回答 (1 件)

Pratik Pawar
Pratik Pawar 2022 年 10 月 3 日
To compile a C/C++ in the Microsoft Visual Studio 19 environments, please perform the steps described in the following link:
I hope the steps mentioned in the above link will resolve the link error.

カテゴリ

Help Center および File ExchangeCall C++ from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by