The compiler can find all the required OpenCV header files, but it cannot find the functions included in the OpenCV library.
cv::CascadeClassifier::~CascadeClassifier()'
/usr/bin/ld: ComputerVision.cpp:(.text+0x688): undefined reference to cv::Mat::deallocate()'
/usr/bin/ld: ComputerVision.cpp:(.text+0x694): undefined reference to cv::Mat::deallocate()'
/usr/bin/ld: ComputerVision.cpp:(.text+0x6a0): undefined reference to cv::Mat::deallocate()'
/usr/bin/ld: ComputerVision.cpp:(.text+0x6ac): undefined reference to cv::Mat::deallocate()'
/usr/bin/ld: ComputerVision.cpp:(.text+0x6dc): undefined reference to cv::VideoCapture::~VideoCapture()'
/usr/bin/ld: ComputerVision.cpp:(.text+0x6e4): undefined reference to cv::CascadeClassifier::~CascadeClassifier()'
/usr/bin/ld: ComputerVision.o: in function cv::Mat::~Mat()':
ComputerVision.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x90): undefined reference to cv::fastFree(void)'
/usr/bin/ld: ComputerVision.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x9c): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
make: ** [Makefile:158: DoorLock] Error 1
/usr/bin/ld: cannot find -lopencv_core
/usr/bin/ld: cannot find -lopencv_imgproc
/usr/bin/ld: cannot find -lopencv_highgui
Update - I copied all the required OpenCV libraries into my usr/lib directory, and that seemed to work. But now I am getting the following error:
libopencv_videoio.so.4.1: error adding symbols: DSO missing from command line
For reference, he is my qmake (.pro) file:
######################################################################
# Automatically generated by qmake (3.1) Sat Nov 27 20:12:38 2021
######################################################################
TEMPLATE = app
TARGET = DoorLock
INCLUDEPATH += . "/home/pi/temp/opencv4"
###"/opt/opencv-4.1.0/include/opencv4"
# The following define makes your compiler warn you if you use any
# feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# Input
HEADERS += Controller.h Inputs.h lcdScreen.h Outputs.h ComputerVision.h
SOURCES += Controller.cpp Inputs.cpp lcdScreen.cpp main.cpp Outputs.cpp ComputerVision.cpp
LIBS += -lpthread -lwiringPi -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_features2d -lopencv_objdetect -lopencv_videoio
QT += core widgets
CONFIG += qt warn_on release
Note temp is a symbolic link to the correct directory
Related
I'm working on an assignment where we have to use RPCgen generated server and client .c files to exchange information about a shared drawing board. The drawing board was implemented using QtCreator and QtPainter.
The issue I'm having is that, when compiling, I get errors of undefined references both to xdr functions such as xdr_int and to functions in the class files I created inside QtCreator related to xdr. I think it's worth saying that the client/server independent code runs fine with the -ltirpc flag.
I've already tried adding the -ltirpc flag both directly in the makefile generated by the .pro + qmake, and only in the pro. file and then running through QtCreator. The LineArea function below is one of the undefined references and the first line, where it creates the client, is a reference to xdr function clnt_create.
LineArea::LineArea(char *hostname, QWidget *parent) : QWidget(parent)
{
clnt = clnt_create(hostname, WHITEBOARD_PROG, WHITEBOARD_VERSION, "udp");
if (clnt)
{
clnt_info = register_client_1(clnt_info, clnt);
setAttribute(Qt::WA_StaticContents);
press_start = false;
pen_width = 2;
pen_color = QColor(clnt_info->r, clnt_info->g, clnt_info->b);
board = QImage(500, 500, QImage::Format_RGB32);
board.fill(qRgb(255, 255, 255));
board_real = board;
update();
}
}
Here's the latest attempt at adding the compile flag to qmake/.pro:
CONFIG += c++11
SOURCES += \
LineArea.cpp \
main.cpp \
mainwindow.cpp \
whiteboard_clnt.c \
whiteboard_xdr.c
HEADERS += \
LineArea.h \
mainwindow.h \
whiteboard.h
FORMS += \
mainwindow.ui
#EXTRA FLAGS
QMAKE_CXXFLAGS += -ltirpc
Any help or suggestion is appreciated.
EDIT: these are the errors at compile time
g++ -Wl,-O1 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o whiteboard LineArea.o main.o mainwindow.o moc_LineArea.o moc_mainwindow.o whiteboard_clnt.c whiteboard_xdr.c whiteboard.h /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so /usr/lib/libGL.so -lpthread
/usr/bin/ld: LineArea.o: in function `LineArea::LineArea(char*, QWidget*)':
LineArea.cpp:(.text+0xa6f): undefined reference to `clnt_create'
/usr/bin/ld: /tmp/ccdM1OwC.o: in function `send_line_1':
whiteboard_clnt.c:(.text+0x43): undefined reference to `xdr_int'
/usr/bin/ld: /tmp/ccdM1OwC.o: in function `remove_client_1':
whiteboard_clnt.c:(.text+0x1cf): undefined reference to `xdr_int'
/usr/bin/ld: /tmp/cccxQLHU.o: in function `xdr_operands':
whiteboard_xdr.c:(.text+0x54): undefined reference to `xdr_int'
/usr/bin/ld: whiteboard_xdr.c:(.text+0x7e): undefined reference to `xdr_int'
/usr/bin/ld: whiteboard_xdr.c:(.text+0xa8): undefined reference to `xdr_int'
/usr/bin/ld: /tmp/cccxQLHU.o:whiteboard_xdr.c:(.text+0xd2): more undefined references to `xdr_int' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:410: whiteboard] Error 1
I'm running make manually, I've added the whiteboard_clnt.c whiteboard_xdr.c and whiteboard.h to the recipe at the makefile. Whithout them the same errors appear, except the xdr errors.
g++ -Wl,-O1 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o whiteboard LineArea.o main.o mainwindow.o moc_LineArea.o moc_mainwindow.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so /usr/lib/libGL.so -lpthread
/usr/bin/ld: LineArea.o: in function `LineArea::recvLines()':
LineArea.cpp:(.text+0x70): undefined reference to `consult_line_1'
/usr/bin/ld: LineArea.o: in function `LineArea::drawLineTo(QPoint const&)':
LineArea.cpp:(.text+0x7a0): undefined reference to `send_line_1'
/usr/bin/ld: LineArea.o: in function `LineArea::LineArea(char*, QWidget*)':
LineArea.cpp:(.text+0xa6f): undefined reference to `clnt_create'
/usr/bin/ld: LineArea.cpp:(.text+0xa86): undefined reference to `register_client_1'
collect2: error: ld returned 1 exit status
make: *** [Makefile:410: whiteboard] Error 1
QMAKE_CXXFLAGS += -ltirpc adds compiler flags, and compiler doesn't care about libraries. Assuming the lib name is correct and found without adding -L library search paths, this should work:
LIBS += -ltirrp
I'm trying to build libVLC for usage within an Android application (I can't find pre-built libs for all the platforms I am targeting). I am using Ubuntu 16.04.1 LTS server and am following the Android compile instructions and installed the packages mentioned there. I have the NDK r13 and SDK r24.4.1, essentially both freshly downloaded.
I started the process with ./compile.sh -a arm --release -l
Everything seems to compile correctly, but then I end up with linker errors. Here's the output starting from what seems most relevant:
Generating static module list
/home/builder/vlc-build/vlc-android/toolchains/arm/bin/arm-linux-androideabi-nm: libiconv.a: File format not recognized
/home/builder/vlc-build/vlc-android/toolchains/arm/bin/arm-linux-androideabi-objcopy:vlc/build-android-arm-linux-androideabi/modules/.libs/libgnutls_plugin.a(libiconv.a): Unable to recognise the format of file: File format not recognized
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by '/libvncclient', not found
Building NDK
Android NDK: WARNING:jni/Android.mk:vlc: non-system libraries in linker flags: /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_window_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsdec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libps_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libkaraoke_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtaglib_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liboldmovie_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libconsole_logger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libshm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcompressor_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcroppadd_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libiomx_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libchorus_flanger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgles2_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liboggspots_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnormvol_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libstereo_widen_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librtp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblpcm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspatializer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libes_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpostproc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfps_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdemux_stl_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfreetype_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libttml_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcache_block_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_copy_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libstl_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmemory_keystore_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpva_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libflacsys_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblogo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librecord_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libflac_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_nv12_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaes3_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtimecode_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdvdread_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsusf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmarq_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libwav_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdecomp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpegaudio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_rgb_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblua_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liba52_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libxml_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcache_read_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdsm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuy2_i422_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadjust_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libogg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvhs_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgaussianblur_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libegl_android_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpng_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libts_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawvideo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgnutls_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpeg4video_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdummy_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsoxr_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtransform_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfile_keystore_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvolume_neon_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsdelay_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspeex_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libremap_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpegvideo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvc1_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libinvert_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libftp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_dirac_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libchain_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libinteger_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librotate_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaudio_format_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfile_logger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmkv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcaf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libau_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmediacodec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvdr_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtelx_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcdg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libg711_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnfs_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfilesystem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnsv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmjpeg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblibass_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvpx_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmono_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubsttml_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsyslog_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_hevc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadpcm_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsatip_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvmem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/liblive555_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_avparser_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libty_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhttp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libzvbi_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libedgedetection_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libwave_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcanvas_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libimem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubstx3g_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsepia_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_yuy2_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvobsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuv_rgb_neon_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgrey_yuv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscaletempo_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspdif_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfluidsynth_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdvdnav_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libparam_eq_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgain_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libadaptive_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdemux_cdg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libupnp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librar_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mlp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_concat_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcolorthres_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libcvdsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnsc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libxa_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libplaylist_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdemuxdump_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi422_yuy2_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtospdif_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_audiotrack_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libinflate_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmpgv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscte18_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavformat_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libopensles_android_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libflaschen_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libprefetch_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmp4_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libattachment_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhds_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libugly_resampler_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmod_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfingerprinter_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaraw_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_mms_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libextract_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuy2_i420_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libzip_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdiracsys_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsvcdsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfreeze_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdvbsub_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libamem_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscale_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtta_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libblend_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libh26x_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librv32_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavi_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libequalizer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_logger_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libudp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libscte27_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavcodec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libyuvp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libavio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfloat_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_vc1_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaiff_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsdp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdeinterlace_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libchroma_yuv_neon_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_realrtsp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhttps_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawaud_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libuleaddvaudio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libswscale_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libasf_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvoc_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libgradfun_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtrivial_channel_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmpg123_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libaccess_archive_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libmicrodns_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawdv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libhqdn3d_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi422_i420_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libafile_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsimple_channel_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libantiflicker_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_dts_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libheadphone_channel_mixer_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsftp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libvorbis_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_flac_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/librawvid_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libanaglyph_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtcp_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libtheora_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libspudec_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libopus_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libnuv_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libdolby_surround_decoder_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_h264_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libi420_10_p010_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libimage_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libandroid_native_window_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libfolder_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libjpeg_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_mpeg4audio_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libsubtitle_plugin.a /home/builder/vlc-build/vlc-android/.modules/build-android-arm-linux-androideabi/libpacketizer_a52_plugin.a /home/builder/vlc-build/vlc-android/vlc/build-android-arm-linux-androideabi/lib/.libs/libvlc.a /home/builder/vlc-build/vlc-android/vlc/build-android-arm-linux-androideabi/src/.libs/libvlccore.a /home/builder/vlc-build/vlc-android/vlc/build-android-arm-linux-androideabi/compat/.libs/libcompat.a -ldvdnav -ldvdread -ldvdcss -ldvdread -ldvdcss -lFLAC -logg -lfluidlite -lvorbisfile -lvorbis -logg -lfreetype -lfribidi -lgnutls /home/builder/vlc-build/vlc-android/vlc/contrib/arm-linux-androideabi/lib/libiconv.a -lgmp -lharfbuzz -lhogweed -lgmp -lnettle -larchive -lass -liconv -lfribidi -lfreetype -lavcodec -lopenjpeg -lgsm -lavutil -lavformat -lopenjpeg -lgsm -lavcodec -lopenjpeg -lgsm -lavutil -lavutil -ldsm -ldvbpsi -ldvdcss -lebml -lmatroska -lebml -lmodplug -lmpg123 -lnfs -lpng16 -lpng16 -lpostproc -lavutil -lssh2 -lgcrypt -lgpg-error -lswscale -lavutil -ltasn1 -lupnp -lthreadutil -lixml -lxml2 -lmicrodns -lnettle -logg -lopus -lprotobuf-lite -lprotobuf -lsoxr -lspeexdsp -lspeex -ltag_c -ltag -ltag -ltheoradec -logg -ltheoraenc -ltheoradec -logg -ltheora -logg -lvorbisenc -lvorbisfile -lvorbis -logg -lvpx -lzvbi -liconv -lpng -lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock -la52 -ljpeg -lavcodec -lebml -llua -lc++abi -landroid_support
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
make: Entering directory `/home/builder/vlc-build/vlc-android/libvlc'
[armeabi-v7a] Compile thumb : vlc <= libvlcjni-modules.c
[armeabi-v7a] Compile thumb : vlc <= libvlcjni-symbols.c
[armeabi-v7a] Compile++ thumb: vlc <= dummy.cpp
[armeabi-v7a] Prebuilt : libc++_shared.so <= <NDK>/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/
[armeabi-v7a] SharedLibrary : libvlc.so
../../modules/lua/vlc.c:219: error: undefined reference to 'config_GetLibDir'
../../modules/lua/vlc.c:229: error: undefined reference to 'config_GetDataDir'
../../modules/lua/libs/configuration.c:110: error: undefined reference to 'config_GetDataDir'
../../modules/arm_neon/volume.c:49: error: undefined reference to 'vlc_CPU'
../../modules/arm_neon/yuv_rgb.c:137: error: undefined reference to 'vlc_CPU'
../../modules/video_filter/deinterlace/deinterlace.c:696: error: undefined reference to 'vlc_CPU'
../../modules/arm_neon/chroma_yuv.c:220: error: undefined reference to 'vlc_CPU'
../../src/misc/threads.c:89: error: undefined reference to 'vlc_addr_timedwait'
../../src/misc/threads.c:148: error: undefined reference to 'vlc_addr_signal'
../../src/misc/threads.c:154: error: undefined reference to 'vlc_addr_broadcast'
../../src/misc/threads.c:173: error: undefined reference to 'vlc_addr_wait'
../../src/misc/threads.c:197: error: undefined reference to 'vlc_addr_timedwait'
../../src/misc/threads.c:148: error: undefined reference to 'vlc_addr_signal'
../../src/misc/threads.c:154: error: undefined reference to 'vlc_addr_broadcast'
../../src/misc/threads.c:148: error: undefined reference to 'vlc_addr_signal'
../../src/misc/messages.c:121: error: undefined reference to 'vlc_thread_id'
../../src/android/thread.c:321: error: undefined reference to 'vlc_addr_broadcast'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [jni/obj/local/armeabi-v7a/libvlc.so] Error 1
make: Leaving directory `/home/builder/vlc-build/vlc-android/libvlc'
ndk-build failed for libvlc
There's a few things worrying in there like the warning about non-system libraries (but isn't that expected since it is a cross-compile?) but they don't seem to connect to the issue.
I can't seem to find anything relevant in Google nor on Stackoverflow (except maybe this question and answer hinting perhaps I should try an older version of the NDK?) as these seem to all be functionality provided by VLC itself. As a result I'm also not sure where to look in the compile process' logs or output to find other hints of things being awry. What else should I post?
I'm rather late to the party but posting anyways.
Package zlib was not found in the pkg-config search path.
Missing dependencies surface as totally irrelevant errors sadly.
I've written a relatively simple Qt program that I'm trying to compile for windows with MinGW under Qt Creator. The Debug version builds and runs without problem, but when I try to build the Release version I get these errors
main.cpp:-1: error: undefined reference to `_imp___ZN12QApplicationC1ERiPPci'
main.cpp:-1: error: undefined reference to `_imp___ZN7QWidget4showEv'
main.cpp:-1: error: undefined reference to `_imp___ZN12QApplication4execEv'
main.cpp:-1: error: undefined reference to `_imp___ZN12QApplicationD1Ev'
main.cpp:-1: error: undefined reference to `_imp___ZN12QApplicationD1Ev'
:-1: error: release/main.o: bad reloc address 0x13 in section `.eh_frame'
collect2.exe:-1: error: error: ld returned 1 exit status
The errors seem to suggest that one or more of the core Qt libraries cannot be found, however, the .pro file contains the line QT += core gui widgets and there is nothing Debug/Release specific. I've tried cleaning/rebuilding the project and restarting Qt Creator, to no avail. I have no problems compiling Release builds for other projects. I'm using Qt version 5.2.1. Any ideas?
Update:
I've singled out this line in the .pro file as the cause
win32: LIBS += -L"C:/Program Files (x86)/MATLAB/R2015b/bin/win32" -llibmat -llibmx
Inside the makefile I see this
LIBS = -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmain "-LC:/Program Files (x86)/MATLAB/R2015b/bin/win32" -llibmat -llibmx -LC:\Qt\Qt5.2.1\5.2.1\mingw48_32\lib -lQt5Widgets -lQt5Gui -lQt5Core
I suspect the problem lies in the order in which the link libraries are listed in the makefile. I vaguely recall encountering a similar problem in the past. How can I force qmake to place the Matlab libraries at the end of the list?
I'm trying to compile my own object detector by using OpenCV 3 hog and svm over Eclipse CDT but when compiling the console returns the following:
Building target: HogDetection
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o "HogDetection" ./main.o ./phog.o ./psvm.o -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_ml
./phog.o: In function `cv::HOGDescriptor::HOGDescriptor()':
/usr/local/include/opencv2/objdetect.hpp:348: undefined reference to `vtable for cv::HOGDescriptor'
./phog.o: In function `cv::HOGDescriptor::~HOGDescriptor()':
/usr/local/include/opencv2/objdetect.hpp:372: undefined reference to `vtable for cv::HOGDescriptor'
collect2: error: ld returned 1 exit status
make: *** [HogDetection] Error 1
Probably I'm doing something wrong with the libraries but since I'm new both to c++ and OpenCV I followed a tutorial to set up eclipse CDT with openCV and I was able to run other simple tutorials (those on openCV websites like display image and so on...).
I also read something on wikipedia about vtable and here but it was not sufficient for me to understand what's happening here.
Thanks in advance.
I solved the problem by adding to the gcc c++ linker libraries the library opencv_objdetect
Well if you are working with make files then just add
LIBS += -L/usr/local/libs \
-lopencv_objdetect \
or if you are not having makefile then just run code like
g++ -Wall main.cpp /usr/lib/libopencv_objdetect.a -o main
I am following this example here.
This is the output I get for make
admin#localhost qtest$ make
g++ -Wl,-O1 -Wl,-rpath,/home/admin/Qt/5.3/gcc_64 -Wl,-rpath,/home/admin/Qt/5.3/gcc_64/lib -o qtest qtest.o -L/home/admin/Qt/5.3/gcc_64/lib -lQt5Gui -lQt5Core -lGL -lpthread
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [qtest] Error 1
admin#localhost qtest$
My cpp file is this
#include <QtWidgets/qapplication.h>
#include <QtWidgets/qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
hello.show();
return a.exec();
}
Any suggestions on how I can fix this ?
Update
This is what I get after
sudo yum install mesa-libGL-devel -y
Trying again to build :
admin#localhost qtest$ make
g++ -Wl,-O1 -Wl,-rpath,/home/admin/Qt/5.3/gcc_64 -Wl,-rpath,/home/admin/Qt/5.3/gcc_64/lib -o qtest qtest.o -L/home/admin/Qt/5.3/gcc_64/lib -lQt5Gui -lQt5Core -lGL -lpthread
qtest.o: In function `main':
qtest.cpp:(.text.startup+0x22): undefined reference to `QApplication::QApplication(int&, char**, int)'
qtest.cpp:(.text.startup+0x4f): undefined reference to `QPushButton::QPushButton(QString const&, QWidget*)'
qtest.cpp:(.text.startup+0x74): undefined reference to `QWidget::resize(QSize const&)'
qtest.cpp:(.text.startup+0x7c): undefined reference to `QWidget::show()'
qtest.cpp:(.text.startup+0x81): undefined reference to `QApplication::exec()'
qtest.cpp:(.text.startup+0x8c): undefined reference to `QPushButton::~QPushButton()'
qtest.cpp:(.text.startup+0x94): undefined reference to `QApplication::~QApplication()'
qtest.cpp:(.text.startup+0xab): undefined reference to `QApplication::~QApplication()'
qtest.cpp:(.text.startup+0xbe): undefined reference to `QPushButton::~QPushButton()'
qtest.cpp:(.text.startup+0xce): undefined reference to `QPushButton::~QPushButton()'
collect2: error: ld returned 1 exit status
make: *** [qtest] Error 1
To solve your error :
/usr/bin/ld: cannot find -lGL
you should install the missing mesa package by running the following install command as root or using sudo :
sudo yum install mesa-libGL-devel -y
Open up your foo.pro file.
You probably have something like:
######################################################################
# Automatically generated by qmake (3.0) Mon Nov 17 14:00:29 2014
######################################################################
TEMPLATE = app
TARGET = test
INCLUDEPATH += .
# Input
SOURCES += foo.cpp
Add to the top, "QT += widgets", such that your file now reads:
######################################################################
# Automatically generated by qmake (3.0) Mon Nov 17 14:00:29 2014
######################################################################
QT += widgets
TEMPLATE = app
TARGET = test
INCLUDEPATH += .
# Input
SOURCES += foo.cpp
then run qmake and make. This should allow it to find the relevant headers.
Your second error is not with libraries, but with finding the QtCore and QtWidgets modules of Qt.