创建链接到Intel的ipp库的mex文件

时间:2017-04-09 07:22:19

标签: c++ matlab mex lnk2019 intel-ipp

我试图通过用c ++程序替换它的一部分来提高我的matlab代码性能,为此我使用了intel的ipp库。尝试编译和链接程序时出现问题。我收到了更多错误。

我使用的是Matlab2016a 64位,Windows 10 64位和使用' Microsoft Visual C ++ 2015 Professional'。

谢谢!

Nadav

  
    

mex nesta.cpp -L' C:\ Program Files(x86)\ IntelSWTools \ compilers_and_libraries_2017.2.187 \ windows \ ipp \ lib \ intel64_win' -I' C:\ Program Files(x86)\ IntelSWTools \ compilers_and_libraries_2017.2.187 \ windows \ ipp \ include' 使用' Microsoft Visual C ++ 2015 Professional'构建。     使用mex时出错        创建库nesta.lib和对象nesta.exp     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsAdd_32fc_I(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsAdd_32fc(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsMulC_32fc(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsMul_32fc" void __cdecl     perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint @@ YAXPEAUIpp32fc @@ M0PEAM @ Z)     nesta.obj:错误LNK2019:未解析的外部符号ippsSub_32fc_I在函数" int __cdecl nesta中引用(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsSub_32fc(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsDiv_32fc_I" void __cdecl     perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint @@ YAXPEAUIpp32fc @@ M0PEAM @ Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsConj_32fc" void __cdecl     perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint @@ YAXPEAUIpp32fc @@ M0PEAM @ Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsSum_32fc" void __cdecl     perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint @@ YAXPEAUIpp32fc @@ M0PEAM @ Z)     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsMax_32f(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsNorm_L2_32fc64f" void __cdecl     perform_L1_constraint(struct Ipp32fc *,float,struct Ipp32fc *,float *)" (?perform_L1_constraint @@ YAXPEAUIpp32fc @@ M0PEAM @ Z)     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsDFTInit_C_32fc(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsDFTFwd_CToC_32fc" void __cdecl A(struct Ipp32fc     *,struct Ipp32fc *,struct DFTSpec_C_32fc *)" (?甲@@ YAXPEAUIpp32fc @@ 0PEAUDFTSpec_C_32fc @@@ Z)     nesta.obj:错误LNK2019:函数中引用的未解析的外部符号ippsDFTInv_CToC_32fc" void __cdecl At(struct Ipp32fc     *,struct Ipp32fc *,struct DFTSpec_C_32fc *)" (?在@@ YAXPEAUIpp32fc @@ 0PEAUDFTSpec_C_32fc @@@ Z)     nesta.obj:错误LNK2019:函数" int __cdecl nesta中引用的未解析的外部符号ippsAbs_32fc_A11(struct Ipp32fc     *,struct Ipp32fc *)" (?内斯塔@@ YAHPEAUIpp32fc @@ @ 0 Z)     nesta.mexw64:致命错误LNK1120:15个未解析的externals`enter code here

  

1 个答案:

答案 0 :(得分:1)

看起来我解决了它。 -l标志没有像我预期的那样工作。

此命令有效:

mex 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\ipp\lib\intel64_win\*.lib' nesta.cpp -I'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\ipp\include'