mex error for path names with spaces
6 ビュー (過去 30 日間)
古いコメントを表示
I'm running Matlab R2016b (no, I can't upgrade it, that's what my employer is licensed for) on Windows, and trying to use mex to compile a c++ script I was given. I need to include MySQL in the compile, and I'm trying to do so as follows:
mex <my script> -I'C:\Program Files\MySQL\MySQL Server 8.0\include\' -L'C:\Program Files\MySQL\MySQL Server 8.0\lib' -lmysqlclient
I get the following error:
Building with 'MinGW64 Compiler (C++)'.
Error using mex
g++: error: Files\MATLAB\R2016b/extern/include -IC:\Program: Invalid argument
g++: error: Files\MATLAB\R2016b/simulink/include -fexceptions -fno-omit-frame-pointer -std=c++11 -O -DNDEBUG
C:\Users\marina\ZooScanDatabase_scripts_GUI_access_09Jun2021_R2016b\mysql.cpp -o
C:\Users\marko\AppData\Local\Temp\mex_71592438356584_12624\mysql.obj : No such file or directory
g++: fatal error: no input files
compilation terminated.
It looks like mex is having problems with the spaces in the path names I'm giving to -I and -L. I tried different combinations of single and double qotes, as well as no quotes at all, but nothing works. Is there a way to get around this?
1 件のコメント
Jan
2021 年 9 月 23 日
"I tried different combinations of single and double quotes"
It is useful to post, what you have tried. Then the readers do not have to post this again.
採用された回答
Marina Frants
2021 年 9 月 24 日
3 件のコメント
Walter Roberson
2021 年 9 月 27 日
mex('mysql.cpp',...
'-I"C:\Program Files\MySQL\MySQL Server 8.0\include\"',...
'-L"C:\Program Files\MySQL\MySQL Server 8.0\lib\"',...
'-llibmysql')
その他の回答 (2 件)
Jan
2021 年 9 月 23 日
Try this:
mex('<my script>', '-I"C:\Program Files\MySQL\MySQL Server 8.0\include\"', ...
'-L"C:\Program Files\MySQL\MySQL Server 8.0\lib"', '-lmysqlclient')
Steven Lord
2021 年 9 月 23 日
Wrap all the text inputs that can contain spaces in single quotes.
disp 'Hello world!' % Equivalent of disp('Hello world!')
fprintf '%s \t%s\n' 'abracadabra' 'hocus pocus' % fprintf('%s \t%s\n', 'abracadabra', 'hocus pocus')
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!