Can't run matcreat.cpp in Windows
이전 댓글 표시
I want to use C++ code to produce .mat files under 64 bit Windows 10 with mingw MSYS2. Therefore, I wanted to take a look at the example matcreat.cpp (MATLAB command:
edit([matlabroot '/extern/examples/eng_mat/matcreat.cpp']);
). In contrast to compilation error, I can successfully compile the cpp file with the following command:
g++ -c -I/c/Program\ Files/MATLAB/R2016a/extern/include matcreat.cpp -o matcreat.o
g++ -o matcreat matcreat.o -L/c/Program\ Files/MATLAB/R2016a/bin/win64 -lmex -lmat -lmx -leng -lstdc++
But when I run the program with
./matcreat.exe
I get the error message
my_directory/matcreat.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
although I added
C:\Program Files\MATLAB\R2016a\bin\win64
to my Windows environment variable. Any ideas to solve that problem are highly appreciated.
댓글 수: 2
Walter Roberson
2016년 9월 27일
You need Dependency Walker or equivalent to figure out which shared library is giving the problem.
Ahmed Hraoui
2016년 9월 28일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Build MATLAB Interface to C++ Library에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!