Why am I getting an error saying “Error using mex, undefined reference to dlopen” when running a MathWorks Embedded Coder example in Linux?
Show older comments
I am using MATLAB R2016b and Linux OS with Ubuntu 16.04.2. I am trying to run the Embedded Coder example “Package Generated Code as Shared Libraries”, linked below.
https://www.mathworks.com/help/ecoder/ug/creating-and-using-host-based-shared-libraries.html
I get the following error when I run the example’s script, “run_rtwdemo_shrlib_app.m”.
Error using mex
/tmp/mex_16491860249446_2818/rtwdemo_shrlib_app.o: In function `main':
rtwdemo_shrlib_app.c:(.text+0x1e): undefined reference to `dlopen'
rtwdemo_shrlib_app.c:(.text+0x55): undefined reference to `dlsym'
rtwdemo_shrlib_app.c:(.text+0x67): undefined reference to `dlsym'
rtwdemo_shrlib_app.c:(.text+0x79): undefined reference to `dlsym'
rtwdemo_shrlib_app.c:(.text+0x8c): undefined reference to `dlsym'
rtwdemo_shrlib_app.c:(.text+0x9e): undefined reference to `dlsym'
/tmp/mex_16491860249446_2818/rtwdemo_shrlib_app.o:rtwdemo_shrlib_app.c:(.text+0xb0):
more undefined references to `dlsym' follow
/tmp/mex_16491860249446_2818/rtwdemo_shrlib_app.o: In function `main':
rtwdemo_shrlib_app.c:(.text+0x11c): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Accepted Answer
More Answers (0)
Categories
Find more on BeagleBone Black in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!