Error using codegen - R2016b on Ubuntu14.04

When I run "FaceTrackingKLTpackNGoExample.m", I get the following error
>> FaceTrackingKLTpackNGoExample
-> Generating Code (it may take a few minutes) ....
??? Build error: Build failed for project 'FaceTrackingKLTpackNGo_kernel'. See the Target Build Log in
the report for further details.
Error in ==> FaceTrackingKLTpackNGo_kernel Line: 1 Column: 1
Code generation failed: View Error Report
Error using codegen
Error in FaceTrackingKLTpackNGoExample (line 70)
codegen(codegenArgs{:}, fileName);
When I click "View Error Report", I see the following
/usr/bin/ld: HostLib_rtw.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake: *** [/tmp/tp44a3c425_46b9_48ab_b357_fe1e097b3d62/codegen/FaceTrackingKLTpackNGo_kernel] Error 1
Has anyone ever experienced the same problem? Any solution please?

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Oct. de 2016

0 votos

You may need to add the "dl" library to be linked. If you are working from the command line that would be by adding -ldl
I see in the error message a reference to /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libdl.so . The first .. would take you up to where 4.8 was a child; the second .. would take you up to where x86_64-linux-gnu was a child; the third .. would take you up to where gcc was a child, so that would seem to resolve to /usr/lib/x86_64-linux-gnu/libdl.so . I wonder if that actually exists or if the file is really in /usr/lib/gcc/x86_64-linux-gnu/libdl.so ? Is /usr/lib/gcc/x86_64-linux-gnu/libdl.so perhaps a symlink that resolves to /usr/lib/x86_64-linux-gnu/libdl.so ?

5 comentarios

Seong Hun Lee
Seong Hun Lee el 1 de Oct. de 2016
Thank you very much for your answer.
1. I am not working from the command line. Can you please be more specific about how I can link the "dl" library?
2. The actual path of "libdl.so" file is /usr/lib/x86_64-gnu/libdl.so. This file is a link to /lib/x86_64-linux-gnu/libdl.so.2 which itself is a link to /lib/x86_64-linux-gnu/libdl2-19.so. There is no file named "libdl.so" in any of the subfolders of /usr/lib/gcc/x86_64-linux-gnu. Do you think that could be the reason?
At the MATLAB command line,,
edit FaceTrackingKLTpackNGoExample
At about line 83 you will see
unzipFolderLocation = unzipPackageContents(zipFileLocation);
After that line add
fprintf('Target directory: "%s"\n', unzipFolderLocation);
and then try to run the code. When the gmake fails, at the MATLAB command line, cd to the directory that was printed out there (which should be the same directory from the gmake error message). Once there,
edit Makefile
At approximately line 75 there should be
###########################################################################
## SYSTEM LIBRARIES
###########################################################################
SYSTEM_LIBS = -lm -ldl
Please indicate whether that SYSTEM_LIBS is the same in your version, or if instead it looks like
SYSTEM_LIBS = -lm
without any -ldl
?
Seong Hun Lee
Seong Hun Lee el 2 de Oct. de 2016
Editada: Seong Hun Lee el 2 de Oct. de 2016
The problem is that running the script gives me an error in line 70 when the "codegen" function is first used:
67: %%Create the Packaged Zip-file
68: % Invoke codegen command with packNGo function call.
69: fprintf('-> Generating Code (it may take a few 70: minutes) ....\n');
70: codegen(codegenArgs{:}, fileName);
So the line 83 is never reached in the first place...
These are the other directory addresses which I can print:
visiondemo_dir: "/usr/local/MATLAB/R2016b/toolbox/vision/visiondemos"
currentDir: "/home/seonghunlee/OpenSourceCode/MATLAB_code/MATLAB_CV_DEMO"
codegenOutDir: "/tmp/tpe5458449_5603_4a0d_b59a_e86c0f8e0489/codegen"
Walter Roberson
Walter Roberson el 2 de Oct. de 2016
Look in the directory codegenOutDir -- you might have to look a directory down from there to find the Makefile
Seong Hun Lee
Seong Hun Lee el 2 de Oct. de 2016
Editada: Seong Hun Lee el 2 de Oct. de 2016
Unfortunately, there is no Makefile in codegenOutDir.... :(
This it the directory structure:
|-- codegenOutDir
|-- buildinfo.mat
|-- FaceTrackingKLTpackNGo_kernel.zip
|-- codegen
|--exe
|--FaceTrackingKLTpackNGo_kernel
|--examples
|--html
|--interface
|--Other bunch of generated .c, .h, .o files

Iniciar sesión para comentar.

Categorías

Más información sobre Code Verification en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 1 de Oct. de 2016

Editada:

el 2 de Oct. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by