フィルターのクリア

Why do I receive error LNK1104: cannot open file libboost_z​lib-vc142-​mt-x64-1_8​4.lib

19 ビュー (過去 30 日間)
骏昌 王
骏昌 王 2024 年 4 月 8 日
回答済み: Suman 2024 年 7 月 24 日 10:27
I receive "error LNK1104: cannot open file libboost_zlib-vc142-mt-x64-1_84.lib" when I run following code
mex -v "D:\csvfile\hubs\fastTableReadV3.cpp" -ID:\boost_1_84_0 -LD:\boost_1_84_0\stage\lib
I find the file "libboost_zlib-vc142-mt-x64-1_84.lib" in "D:\boost_1_84_0\stage\lib". I can't figure out why it still have this error.
  3 件のコメント
骏昌 王
骏昌 王 2024 年 4 月 9 日
@Manikanta Aditya When I use the form
mex -v "D:\csvfile\hubs\fastTableReadV3.cpp" -I'D:\boost_1_84_0\'
it does not make any different and same error was raised.
mex -v "D:\csvfile\hubs\fastTableReadV3.cpp" -I"D:\boost_1_84_0\"
MATLAB don't recognize this form as valid parameter.
Yuchen
Yuchen 2024 年 5 月 3 日
Hello,
Please check the document about "mex" in MATLAB:
https://www.mathworks.com/help/matlab/ref/mex.html

サインインしてコメントする。

回答 (1 件)

Suman
Suman 2024 年 7 月 24 日 10:27
As per the documentation, https://www.mathworks.com/help/matlab/ref/mex.html#btw17rw-1-option1optionN, If used, the -L option must precede the -l option. Hence, you also need to pass the libname using the -l option. Note that you do not have to add the library extension, i.e., .lib or .so etc.
>> -Llibfolder -llibname
Links with dynamic object library libname in (optional) libfolder.
MATLAB expands libname to:
  • libname.lib or liblibname.lib — Windows systems
  • liblibname.dylib macOS systems
  • liblibname.so — Linux systems
If used, the -L option must precede the -l option. When using the -L option on Linux or macOS systems, you also must set the runtime library path, as explained in Set Run-Time Library Path.
Specify the -l option with the lowercase letter L. Do not add a space between l and libname or between L and libfolder.
To link a static library, use the filenames input argument.
Hope this helps!

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by