'File format not recognized" using mex
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm trying to create a mex executable to a file that uses a linker to a library "libraryname", where libraryname.lib is a linker that I created on my machine using "lib" function from VC++. Everything works well when I run mex on the same machine that was used to create the .lib file. Now I want to run this on the cluster, but there I cannot create a new .lib file, so I need to use the .lib file that I created on my computer. When I run the same mex command on the cluster machine I get the following error:
Command:
mex source_code.c libraryname.lib
error:
/usr/bin/ld: libraryname.lib(libraryname.dll): Recognised but unhandled machine
type (0x8664) in Import Library Format archive
libraryname.lib: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status
I found a much older thread on a similar problem here, but I'm not sure if this is applicable to Matlab 2019b
Could anyone give a hint on how to resolve this?
0 件のコメント
回答 (1 件)
Nipun Katyal
2020 年 8 月 14 日
This problem occurs because the supported file type is .so/.dll and not .lib/.dll. If you want to tell the linker to link this library you should specify it in this format
mex source file<*.c> -L<path to the library> -lLibraryName
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!