簡體   English   中英

MATLAB MEX已成功完成,但未創建.mexw64文件

[英]MATLAB MEX completed successfully but no .mexw64 file is created

在MATLAB中嘗試使用MinGW 4.9.2編譯器編譯我的C ++文件時:

mex -largeArrayDims -O -output edtlicense LD=g++ LINKLIBS="$LINKLIBS -liphlpapi" edtlicense_mex.o edtlicense.o bigint.o ripemd128.o rsa.o getmac.o

我得到以下輸出:

使用'MinGW64編譯器(C)'構建。 MEX成功完成。

但是,不會創建edtlicense.mexw64文件。

現在有人可能會導致這種情況以及如何解決這個問題嗎? 這是正常的:

用'MinGW64編譯器(C)'構建

出現而不是

用'MinGW64編譯器(C ++)構建


編輯:

@Amro,這是運行命令的輸出:

>> mex -largeArrayDims -cxx -v -n -output edtlicense edtlicense_mex.o edtlicense.o bigint.o ripemd128.o rsa.o getmac.o -liphlpapi

... Looking for compiler 'MinGW64 Compiler (C++)' ...
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\TDM-GCC-64').
... Looking for file 'C:\TDM-GCC-64\bin\g++.exe' ...Yes.
... Looking for folder 'C:\TDM-GCC-64\' ...Yes.

Found installed compiler 'MinGW64 Compiler (C++)'.

Set PATH = [...truncated...]
Set INCLUDE = C:\TDM-GCC-64\\include;
Set LIB = C:\TDM-GCC-64\\lib;;
Set MW_TARGET_ARCH = win64;
Set LIBPATH = C:\Program Files\MATLAB\R2015b\extern\lib\win64;

Error using mex
MEX cannot find library 'iphlpapi' specified with the -l option.
MEX looks for a file with one of the names:
 libiphlpapi.lib
 iphlpapi.lib
Please specify the path to this library with the -L option.

請嘗試以下方法:

mex -largeArrayDims -output edtlicense
  edtlicense_mex.o edtlicense.o bigint.o ripemd128.o rsa.o getmac.o
  LINKLIBS="$LINKLIBS -liphlpapi -lws2_32"

(所有在一行中,我只是添加了換行符以便於閱讀)。

似乎直接指定鏈接為mex ... -lfoo -lbar庫在使用MinGW時對於mex命令是有問題的...它甚至在調用編譯器/鏈接器之前嘗試查找foo.libbar.lib文件,使用MinGW時可能並不總是可用(在上面的例子中,它是一個名為libiphlpapi.a的靜態lib文件)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM