Sysprogs forums › Forums › VisualGDB › OpenCV Qt Linker error
- This topic has 3 replies, 3 voices, and was last updated 11 years ago by ket.
-
AuthorPosts
-
November 7, 2013 at 23:12 #679diggyParticipant
Hy,
I like to use Qt OpenCV on rasberryPi using VisualGDB with VisualStudio2010.
I bbuild a Qt app without opencv, that works fine.
I build a test application using opencv without qt and modify “debug.mak” with Libs:LIBRARY_NAMES := pthread rt z jpeg png12 tiff jasper gtk-x11-2.0 gobject-2.0 glib-2.0 avcodec avformat avutil swscale dc1394 opencv_core opencv_imgproc opencv_highgui opencv_ml opencv_video opencv_features2d opencv_calib3d opencv_objdetect opencv_contrib opencv_legacy opencv_flann
SYSROOT := C:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot
LDFLAGS := -Wl,-gc-sections $(SYSROOT)/lib/arm-linux-gnueabihf/librt.so.1
$(SYSROOT)/lib/arm-linux-gnueabihf/libpng12.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so.0
$(SYSROOT)/lib/arm-linux-gnueabihf/libglib-2.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libv4l1.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libjbig.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpangocairo-1.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libX11.so.6
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXcomposite.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXdamage.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXfixes.so.3
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libatk-1.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libcairo.so.2
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgdk_pixbuf-2.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpangoft2-1.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpango-1.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libfreetype.so.6
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libfontconfig.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libffi.so.5
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxvidcore.so.4
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libx264.so.123
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libvpx.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libvorbisenc.so.2
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libvorbis.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libtheoraenc.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libtheoradec.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libspeex.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libschroedinger-1.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libmp3lame.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgsm.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libdirac_encoder.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libva.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/librtmp.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgnutls.so.26
$(SYSROOT)/lib/arm-linux-gnueabihf/libbz2.so.1.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libraw1394.so.11
$(SYSROOT)/lib/arm-linux-gnueabihf/libusb-1.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXext.so.6
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXrender.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXinerama.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXi.so.6
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXrandr.so.2
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXcursor.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libv4l2.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libgmodule-2.0.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxcb.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libpixman-1.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxcb-shm.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libxcb-render.so.0
$(SYSROOT)/lib/arm-linux-gnueabihf/libselinux.so.1
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libogg.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/liborc-0.4.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libtasn1.so.3
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libp11-kit.so.0
$(SYSROOT)/lib/arm-linux-gnueabihf/libdl.so.2
$(SYSROOT)/lib/arm-linux-gnueabihf/libexpat.so.1
$(SYSROOT)/lib/arm-linux-gnueabihf/libgcrypt.so.11
$(SYSROOT)/lib/arm-linux-gnueabihf/libresolv.so.2
$(SYSROOT)/lib/arm-linux-gnueabihf/libpcre.so.3
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libv4lconvert.so.0
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXau.so.6
$(SYSROOT)/usr/lib/arm-linux-gnueabihf/libXdmcp.so.6
$(SYSROOT)/lib/arm-linux-gnueabihf/libgpg-error.so.0this works fine.
But if I Combine both (qt and opencv) I get linker error:
>C:ProjekteQtCam_PiQtCam_PiMainWindow.cpp(86): error VGDB1000: undefined reference to `cvReleaseCapture’
1> collect2: ld returned 1 exit status
1> make: *** [Debug/QtCam_Pi] Error 1what file must be edit link path and filenames using qt and opencv
Thank you for your Support
DirkNovember 8, 2013 at 06:55 #2768supportKeymasterPlease try surrounding the library list with -Wl,–start-group and -Wl,–end-group. Note that our latest Raspberry toolchain contains the fix that eliminates the need to specify full path for libraries. You can now simply mention them in the LIBRARY_NAMES; dependent libraries will be included automatically. To use this feature you will need to download the latest version of the Raspberry toolchain.
November 8, 2013 at 11:39 #2769diggyParticipantThanks, in which file do I make this change? using without Qt I had a file named debug.mak. I included the libs in that file. But using Qt I don’t have this file. I only found the debug.pro with the line: “LIBS +=”
When I insert the libnames there I get an error.
should I insert only the lib names into the qt project file (*.pro)?
Best regards
DirkNovember 10, 2013 at 23:05 #2770ketParticipantHi,
You can try adding the QMAKE_LFLAGS variable to debug.pro, this variable is used to specify flags to the linker. You can try using it instead of specifying the libraries in the LIBS variable.
Begin the library list with -Wl,–start-group and end it with -Wl,–end-group, the libraries should be declared in between as usual for the LIBS variable.The libraries specified in LIBS are specified differently from LIBRARY_NAMES, the library names should be prefixed with -l. The LIBS variable is also used to specify the library paths, those should be prefixed with -L. If you add libraries and library paths from VisualGDB Project Properties, then the correct syntax is used automatically for LIBS.
-
AuthorPosts
- You must be logged in to reply to this topic.