フィルターのクリア

Specify runtime path with mex

7 ビュー (過去 30 日間)
Aditya
Aditya 2011 年 6 月 6 日
What is the correct syntax for including runtime path with mex? With gcc, the syntax is "gcc -Wl,-rpath,dir1:dir2:etc". When I use same syntax as
mex -cxx -Wl,-rpath,/path/to/lib ...
I get an error that says "Error: Unexpected Matlab operator" at "/" which starts the string "/path/to/lib".
Thanks.

回答 (2 件)

James Tursa
James Tursa 2011 年 6 月 6 日
The parser doesn't always give you what you expect when you include all of your inputs on the command line like you have shown. To be sure of your inputs, use the function form of mex instead:
mex('-cxx','-Wl', etc...)

Kaustubha Govind
Kaustubha Govind 2011 年 6 月 6 日
I would recommend separating out the compiler and linker flags and pass them into MEX using something like:
mex -v CFLAGS="\$CFLAGS -cxx -WI" LDFLAGS="\$LDFLAGS -rpath,/path/to/lib" mymexfile.c

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by