I wrote a c++ plugin, named DPD, that uses OpenCV libraries inside (highgui, imgproc, gpu, core ... ). However, V.REP cannot load it properly, it falls in segmentation fault when trying to load the plugin:
Code: Select all
Using the default Lua library.
Loaded the video compression library.
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'MeshCalc': loading...
Plugin 'MeshCalc': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Collada': loading...
Plugin 'Collada': load succeeded.
Plugin 'ConvexDecompose': loading...
Plugin 'ConvexDecompose': load failed (could not load). The plugin probably couldn't load dependency libraries. Try 'ldd pluginName.so' for more infos, or simply rebuild the plugin.
Plugin 'CustomUI': loading...
Plugin 'CustomUI': load succeeded.
Plugin 'DPD': loading...
Segmentation fault (core dumped)
Code: Select all
CFLAGS = -I../include -I/usr/local/include -fPIC -static `pkg-config --cflags opencv`
LIBS = `pkg-config --libs opencv`
OPENCVLIBS = /usr/lib
OS = $(shell uname -s)
ifeq ($(OS), Linux)
CFLAGS += -D__linux
EXT = so
else
CFLAGS += -D__APPLE__
EXT = dylib
endif
TARGET = lib/libv_repExtDPD.$(EXT)
all:
@rm -f lib/*.$(EXT)
@rm -f ../../libv_repExtDPD.$(EXT)
@rm -f *.o
g++ $(CFLAGS) -c v_repExtDPD.cpp -o v_repExtDPD.o
g++ $(CFLAGS) -c ../common/scriptFunctionData.cpp -o scriptFunctionData.o
g++ $(CFLAGS) -c ../common/scriptFunctionDataItem.cpp -o scriptFunctionDataItem.o
g++ $(CFLAGS) -c ../common/v_repLib.cpp -o v_repLib.o
@mkdir -p lib
g++ scriptFunctionData.o scriptFunctionDataItem.o v_repExtDPD.o v_repLib.o -o $(TARGET) $(LIBS) -shared -ldl -lpthread
@tput bold
@echo 'Copying $(TARGET) in V-REP folder ...'
@tput sgr0
@cp $(TARGET) ../../
Code: Select all
ldd libv_repExtDPD.so
Code: Select all
linux-vdso.so.1 => (0x00007ffce2be8000)
libopencv_core.so.2.4 => /usr/local/lib/libopencv_core.so.2.4 (0x00007f5184479000)
libopencv_gpu.so.2.4 => /usr/local/lib/libopencv_gpu.so.2.4 (0x00007f517e247000)
libopencv_highgui.so.2.4 => /usr/local/lib/libopencv_highgui.so.2.4 (0x00007f517dfb2000)
libopencv_imgproc.so.2.4 => /usr/local/lib/libopencv_imgproc.so.2.4 (0x00007f517dad6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f517d8b9000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f517d6b5000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f517d3a3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f517d0a7000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f517ce90000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f517cad2000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f517c8bb000)
libcudart.so.7.0 => /usr/local/cuda/lib64/libcudart.so.7.0 (0x00007f517c65e000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f517c456000)
libGL.so.1 => /usr/lib/nvidia-346/libGL.so.1 (0x00007f517c0fe000)
libtbb.so.2 => /usr/lib/libtbb.so.2 (0x00007f517bed1000)
libopencv_calib3d.so.2.4 => /usr/local/lib/libopencv_calib3d.so.2.4 (0x00007f517bbf4000)
libopencv_objdetect.so.2.4 => /usr/local/lib/libopencv_objdetect.so.2.4 (0x00007f517b973000)
libnppc.so.7.0 => /usr/local/cuda/lib64/libnppc.so.7.0 (0x00007f517b70c000)
libnppi.so.7.0 => /usr/local/cuda/lib64/libnppi.so.7.0 (0x00007f5177179000)
libnpps.so.7.0 => /usr/local/cuda/lib64/libnpps.so.7.0 (0x00007f51769bc000)
libcublas.so.7.0 => /usr/local/cuda/lib64/libcublas.so.7.0 (0x00007f51749fa000)
libcufft.so.7.0 => /usr/local/cuda/lib64/libcufft.so.7.0 (0x00007f5170b42000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f51708f2000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f51706ca000)
libtiff.so.4 => /usr/lib/x86_64-linux-gnu/libtiff.so.4 (0x00007f5170466000)
libjasper.so.1 => /usr/lib/x86_64-linux-gnu/libjasper.so.1 (0x00007f517020e000)
libIlmImf.so.6 => /usr/lib/libIlmImf.so.6 (0x00007f516ff4d000)
libHalf.so.6 => /usr/lib/libHalf.so.6 (0x00007f516fd0a000)
libgstreamer-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-0.10.so.0 (0x00007f516fa23000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f516f7d4000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f516f4df000)
libgstvideo-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstvideo-0.10.so.0 (0x00007f516f2c3000)
libgstapp-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-0.10.so.0 (0x00007f516f0b7000)
libgstriff-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstriff-0.10.so.0 (0x00007f516eeaa000)
libgstpbutils-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstpbutils-0.10.so.0 (0x00007f516ec87000)
libdc1394.so.22 => /usr/lib/x86_64-linux-gnu/libdc1394.so.22 (0x00007f516ea14000)
libv4l1.so.0 => /usr/lib/x86_64-linux-gnu/libv4l1.so.0 (0x00007f516e80e000)
libv4l2.so.0 => /usr/lib/x86_64-linux-gnu/libv4l2.so.0 (0x00007f516e602000)
libavcodec.so.53 => /usr/lib/x86_64-linux-gnu/libavcodec.so.53 (0x00007f516d7f0000)
libavformat.so.53 => /usr/lib/x86_64-linux-gnu/libavformat.so.53 (0x00007f516d4f0000)
libavutil.so.51 => /usr/lib/x86_64-linux-gnu/libavutil.so.51 (0x00007f516d2d0000)
libswscale.so.2 => /usr/lib/x86_64-linux-gnu/libswscale.so.2 (0x00007f516d08a000)
libQtOpenGL.so.4 => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 (0x00007f516cd8c000)
libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f516c0be000)
libQtTest.so.4 => /usr/lib/x86_64-linux-gnu/libQtTest.so.4 (0x00007f516be98000)
libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f516b9c6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5184bc2000)
libnvidia-tls.so.346.46 => /usr/lib/nvidia-346/tls/libnvidia-tls.so.346.46 (0x00007f516b7c3000)
libnvidia-glcore.so.346.46 => /usr/lib/nvidia-346/libnvidia-glcore.so.346.46 (0x00007f5168aea000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f51687b5000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f51685a4000)
libopencv_flann.so.2.4 => /usr/local/lib/libopencv_flann.so.2.4 (0x00007f5168331000)
libopencv_features2d.so.2.4 => /usr/local/lib/libopencv_features2d.so.2.4 (0x00007f5168084000)
libImath.so.6 => /usr/lib/libImath.so.6 (0x00007f5167e7e000)
libIex.so.6 => /usr/lib/libIex.so.6 (0x00007f5167c5f000)
libIlmThread.so.6 => /usr/lib/libIlmThread.so.6 (0x00007f5167a58000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f5167854000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f51674f8000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f51672f0000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f51670b3000)
libgstbase-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstbase-0.10.so.0 (0x00007f5166e60000)
liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f5166be5000)
libgstaudio-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstaudio-0.10.so.0 (0x00007f51669ae000)
libgsttag-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgsttag-0.10.so.0 (0x00007f5166779000)
libraw1394.so.11 => /usr/lib/x86_64-linux-gnu/libraw1394.so.11 (0x00007f516656a000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007f516635b000)
libv4lconvert.so.0 => /usr/lib/x86_64-linux-gnu/libv4lconvert.so.0 (0x00007f51660e6000)
libvpx.so.1 => /usr/lib/libvpx.so.1 (0x00007f5165e41000)
libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f5165972000)
libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f5165746000)
libtheoraenc.so.1 => /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 (0x00007f5165509000)
libtheoradec.so.1 => /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 (0x00007f51652ee000)
libspeex.so.1 => /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007f51650d5000)
libschroedinger-1.0.so.0 => /usr/lib/libschroedinger-1.0.so.0 (0x00007f5164e22000)
libgsm.so.1 => /usr/lib/libgsm.so.1 (0x00007f5164c14000)
libva.so.1 => /usr/lib/x86_64-linux-gnu/libva.so.1 (0x00007f51649fe000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f51647ee000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f5164551000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f5164347000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f5164111000)
libaudio.so.2 => /usr/lib/x86_64-linux-gnu/libaudio.so.2 (0x00007f5163ef9000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f5163cf1000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f5163ad7000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f51638c7000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f51636a9000)
libgstinterfaces-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstinterfaces-0.10.so.0 (0x00007f5163497000)
libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f5163290000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f5163066000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f5162e00000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f5162bfd000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f51629f8000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f51627f2000)
Thanks in advance.