Building a mat file with a QT application

I have some c++ QT code I would like to use to write data for a .mat file. I have included in the .pro (QT project file) file:
WIN32:LIBS += \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libeng.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libma.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libmex.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libmwblas.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libmqblascompat32.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libmxlapack.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libmwmathutil.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libmx.lib" \
"C:/Program Files/MATLAB/R2010b/extern/lib/win64/microsoft/libut.lib"
I have also included the header files from the examples on mat file writing in the MATLAB installation. For some reason the compiler is not able to find the mat file functions. The error messages are similar to this:
undefined reference to `matOpen'
The only thing I can think of at this point is that the .lib files are compiler specific and won't work with the QT Creator compiler?
If anyone has any suggestions or experience I would really appreciate it.
Thanks in advance

답변 (2개)

Walter Roberson
Walter Roberson 2011년 3월 3일

0 개 추천

.lib files should not be compiler specific (well, not under normal circumstances), but they would be specific about whether they are 32 bit or 64 bit libraries. I believe the ones you list are 64 bit libraries (/win64 subdirectory), but your comment says WIN32 which would be for 32 bit libraries. One or more of us is confused ;-)

댓글 수: 1

Alex
Alex 2011년 3월 3일
You're right, that should be WIN64. Unfortunately that doesn't fix the problem. I have tried several different combinations of LIBS, WIN32:LIBS, -L"<path>".
Thanks for your help, but do you have any other ideas?

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

Kaustubha Govind
Kaustubha Govind 2011년 3월 3일

0 개 추천

One good way to figure out if you're using all the right compiler options is to use the engmatopts.bat option file discussed here, compile with the mex -v (verbose) option to see the exact compiler/linker commands.

댓글 수: 1

Zeljko
Zeljko 2013년 10월 6일
That may be useful when compiling through mex with other compilers, but we are trying to compile within a Qt environment and as far as I can tell, mex has no role there.

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

카테고리

도움말 센터File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

질문:

2011년 3월 3일

댓글:

2013년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by