Simulink CompVision Embedded Coder Generation Bug: HostLib_rtw.c cannot open library: libmwfrommmfile.so with g++ compiler
4 次查看(过去 30 天)
显示 更早的评论
Hi,
The model I used is vipcodec_color.mdl in Computer Vision System Toolbox in Simulink. And I generated the Video source block to C++ block using ert.tlc. It compiles fine with g++ compiler, but at run-time, it failed with no correct output. I dig into it a bit and found out that the generated code has external linkage of HostLib_rtw.c which is from the toolbox lib of glnx86. And in HostLib_rtw.c, it tries to do dlopen("libmwfrommmfile.so", RTLD_NOW | RTLD_LOCAL). It fails by returning null. I tried with both setting LD_LIBRARY_PATH and absolute path in the string of dlopen(), it both failed.
As a comparison, when I generated the code to C (using GCC to link), rather than C++, everything worked fine and dlopen works correctly. But if I added -lstdc++ to the compiling argument of linkage of GCC, same symptom occurred as above.
So, it seems to me that it all comes to the stdc++ linker option.
I'd like to attach some source code and makefile, but not sure how to.
Thank you for your help. Jiaxing
Some basic information:
OS: Linux 32-bit Product: MATLAB R2011b 32bit Environment: Simulink Computer Vision system Toolbox Model: vipcodec_coler.mdl Code Generation Target: ert.tlc
Linking commands: 1. G++ compiler: g++ -m32 -lm -ldl -o ../Video -lm HostLib_MMFile.o HostLib_Multimedia.o HostLib_rtw.o Video.o ert_main.o
Res: dlopen failed
2. GCC compiler: gcc -m32 -lm -ldl -o ../Video -lm HostLib_MMFile.o HostLib_Multimedia.o HostLib_rtw.o Video.o ert_main.o
Res: dlopen succeeded
3. GCC compiler with C++ flag: gcc -m32 -lm -ldl -o ../Video -lm HostLib_MMFile.o HostLib_Multimedia.o HostLib_rtw.o Video.o ert_main.o -lstdc++
Res: dlopen failed
1 个评论
Kaustubha Govind
2012-11-30
Jiaxing: I highly recommend that you report this to MathWorks Tech Support. This could be a bug.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!