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!