Cannot compile to 32 bit using Matlab Coder

5 次查看(过去 30 天)
I am a new Matlab user trying to use the Vision toolbox. I have been trying to compile my matlab program to a 32bit dll from my 64 bit windows machine. Here are the settings that I select:
But I am getting an error as follows:
### Creating dynamic library ".\detectTemplateInImage.dll" ...
link /RELEASE /INCREMENTAL:NO /NOLOGO kernel32.lib ws2_32.lib mswsock.lib advapi32.lib -dll -def:detectTemplateInImage.def `pkg-config --cflags --libs opencv` /nodefaultlib:vcomp -out:.\detectTemplateInImage.dll @detectTemplateInImage_rtw.rsp /LIBPATH:"C:\PROGRA~1\MATLAB\R2020b\bin\win64" "C:\PROGRA~1\MATLAB\R2020b\bin\win64\libiomp5md.lib"
LINK : warning LNK4044: unrecognized option '/-cflags'; ignored
LINK : warning LNK4044: unrecognized option '/-libs'; ignored
LINK : fatal error LNK1181: cannot open input file '`pkg-config.obj'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.EXE"' : return code '0x49d'
Stop.
The make command returned an error of 2
Error(s) encountered while building "detectTemplateInImage"
It seems to be an error with OpenCV but I don't know how to solve it exactly. Would greatly appreciate any help.
Thank you

采纳的回答

Walter Roberson
Walter Roberson 2020-11-1
It was possible in R2015b and earlier to compile for 32 bit dll. It is not possible in any release since then.
It looks like you might have other setup problems, but even if you solved those it would not be possible to compile to 32 bits.
  3 个评论
Walter Roberson
Walter Roberson 2020-11-1
That page is implying that you would not be able to use mingw as the compiler with the libraries that they supply.
The libraries that they supply are 64 bit libraries.
To have a chance with 32 bit you would need 32 bit OpenCV DLLs, either finding them somewhere or compiling yourself.
Kunal Shitut
Kunal Shitut 2020-11-1
Oh okay, thanks. I will look into doing it that way or some other method.

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by