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?
Related
I have a Qt5 C++ program and I'm trying to link to a static library. The static library is senselock/libsenseEIV.a (relative to the main.cpp file). When I compile I see the output below:
^
g++ -Wl,-rpath,/opt/Qt/5.7/gcc_64/lib -o test1 main.o -Lsenselock/libsenseEIV.a -L/opt/Qt/5.7/gcc_64/lib -lQt5Core -lpthread
main.o: In function `test1()':
/test1/main.cpp:31: undefined reference to `S4Enum'
/test1/main.cpp:58: undefined reference to `S4Enum'
/test1/main.cpp:71: undefined reference to `S4Open'
/test1/main.cpp:83: undefined reference to `S4Control'
/test1/main.cpp:102: undefined reference to `S4Close'
collect2: error: ld returned 1 exit status
make: *** [Makefile:216: test1] Error 1
11:55:27: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project test1 (kit: Desktop Qt 5.7.1 GCC 64bit)
When executing step "Make"
and in my .pro file I have
LIBS += -Lsenselock/libsenseEIV.a
in case that matters. Can someone explain how to fix this error? The undefined reference errors all relate to functions located in that libsenseEIV.a library.
I don't understand if the compiler can't find the .a file or there's some other error.
UPDATE: I tried this syntax
LIBS += -Lsenselock -lsenseEIV
but it generates error
/usr/bin/ld: cannot find -lsenseEIV
Am I using the wrong library name? If so how would I find the name? (assuming this is compiled into the .a file)
This part of your command line is wrong:
-Lsenselock/libsenseEIV.a
Should be:
senselock/libsenseEIV.a
(The -Lfoo/bar.a tells linker to search directory foo/bar.a/ for libraries, which is not at all what you want.)
No -l prefix?
You can specify linking with libsenseEIV.a in the following (mostly equivalent) ways:
senselock/libsenseEIV.a
-Lsenselock -lsenseEIV
-Lsenselock -l:libsenseEIV.a
You're using the linker flags wrong, you should specify the library path after -L and the library name after -l. In other words you need to have both in the assignment to LIBS variable in your .pro file.
After all it turns out that you can use LIBS += -L$$PWD/senselock/ -lsenseEIV for your case
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 got a Qt environment that I need to compile.
But when compiling, I get the following messages:
g++ -Wl,-s -mthreads -Wl,-subsystem,windows -o release\Prog.exe object_script.Prog.Release -L"c:\DevProgs\Qt\4.8.6\lib" -lmingw32 -lqtmain build\objects\myapp_res.o -LC:/Windows/System32 -lftd2xx -LC:/qwt-6.0.1/lib -lqwt -lQtSql4 -lQtGui4 -lQtNetwork4 -lQtCore4
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x1fb): undefined reference to `_imp__Sleep#4'
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x293): undefined reference to `_imp__SetUnhandledExceptionFilter#4'
Makefile.Release:303: recipe for target 'release\Prog.exe' failed
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x2a7): undefined reference to `_set_invalid_parameter_handler'
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x475): undefined reference to `_imp__GetStartupInfoA#4'
[MGWPATH]/i686-w64-mingw32/bin/ld.exe: [MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o: bad reloc address 0x0 in section `.CRT$XCAA'
collect2.exe: error: ld returned 1 exit status
where [MGWPATH] is C:/DevProgs/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../..
I sucessfully ran small demos of Qt4.8.6 alone and one with Qwt.
The only doubt I have is regarding the ftd2xx lib.
But, I think it is linked properly because I am able to produce errors of undefined function if I don't link the DLL.
The error message is not clear to me. So, I have absolutely no idea where to look from here!
Could someone help me?
Thank you!
My friend made OpenGL graphic engine, but he is working on Windows. I want to compile project with it.
I installed all required libs with headers, but now problem is with linking (project in Code::Blocks). I found paths for /usr/lib/libSOIL.a and /usr/local/lib/libglfw3.a, but what about:
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libopengl32.a
C:\Program Files (x86)\CodeBlocks\MinGW\lib\assimp_debug-dll_win32\assimp.lib
Also, what I must modify in project file to compile it? It requires: glfw3, glm, gl3w.h, assimp, SOIL (this is what I get from .hpp files). I installed all headers (downloaded sources and make && make install)...
I tried to compile it from terminal with g++, but I don't know switches for libraries.
Current situation:
$ g++ Camera.o Entity.o Frustum.o gl3w.o Light.o Material.o Mesh.o Model.o ModelPart.o Shader.o Texture.o Utilities.o ../main.o -o main -L/usr/local/lib/libglfw3.a -lX11 -lXext -lXt -lSM -lGLU -lglut -lSOIL
/usr/bin/ld: gl3w.o: undefined reference to symbol 'glXGetProcAddress'
/usr/bin/ld: note: 'glXGetProcAddress' is defined in DSO /usr/lib/nvidia-313-updates/libGL.so.1 so try adding it to the linker command line
/usr/lib/nvidia-313-updates/libGL.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
(i added too much libraries to command line, I know)
EDIT
Added -lGL and -ldl and some problems comes out. Now, I'll trying compile it with makefile...
libopengl32 -> libGL.a
assimp -> libassimp.a ?
You gotta provide the Makefile you're compiling it with.
I'm following this tutorial for building a simple OpenGl application in C++ using QT.
I'm trying to compile the application using g++ and the command line but I get the following errors:
/tmp/ccH2KFoZ.o: In function `GLWidget::GLWidget(QWidget*)':
GLWidget.cpp:(.text+0x38): undefined reference to `QGLWidget::QGLWidget(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>)'
GLWidget.cpp:(.text+0x41): undefined reference to `vtable for GLWidget'
GLWidget.cpp:(.text+0x4b): undefined reference to `vtable for GLWidget'
GLWidget.cpp:(.text+0x5e): undefined reference to `QGLWidget::setMouseTracking(bool)'
GLWidget.cpp:(.text+0x6f): undefined reference to `QGLWidget::~QGLWidget()'
/tmp/ccH2KFoZ.o: In function `GLWidget::GLWidget(QWidget*)':
GLWidget.cpp:(.text+0xbe): undefined reference to `QGLWidget::QGLWidget(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>)'
GLWidget.cpp:(.text+0xc7): undefined reference to `vtable for GLWidget'
GLWidget.cpp:(.text+0xd1): undefined reference to `vtable for GLWidget'
GLWidget.cpp:(.text+0xe4): undefined reference to `QGLWidget::setMouseTracking(bool)'
GLWidget.cpp:(.text+0xf5): undefined reference to `QGLWidget::~QGLWidget()'
/tmp/ccH2KFoZ.o: In function `GLWidget::resizeGL(int, int)':
GLWidget.cpp:(.text+0x1e1): undefined reference to `gluOrtho2D'
/tmp/ccH2KFoZ.o: In function `GLWidget::keyPressEvent(QKeyEvent*)':
GLWidget.cpp:(.text+0x2dd): undefined reference to `QWidget::close()'
/tmp/ccDIuk1w.o: In function `main':
main.cpp:(.text+0x29): undefined reference to `QApplication::QApplication(int&, char**, int)'
main.cpp:(.text+0x6a): undefined reference to `QApplication::exec()'
main.cpp:(.text+0xa0): undefined reference to `QApplication::~QApplication()'
main.cpp:(.text+0xb8): undefined reference to `QApplication::~QApplication()'
/tmp/ccDIuk1w.o: In function `QWidget::resize(int, int)':
main.cpp:(.text._ZN7QWidget6resizeEii[QWidget::resize(int, int)]+0x2d): undefined reference to `QWidget::resize(QSize const&)'
/tmp/ccDIuk1w.o: In function `GLWidget::~GLWidget()':
main.cpp:(.text._ZN8GLWidgetD1Ev[GLWidget::~GLWidget()]+0x13): undefined reference to `vtable for GLWidget'
main.cpp:(.text._ZN8GLWidgetD1Ev[GLWidget::~GLWidget()]+0x1d): undefined reference to `vtable for GLWidget'
main.cpp:(.text._ZN8GLWidgetD1Ev[GLWidget::~GLWidget()]+0x28): undefined reference to `QGLWidget::~QGLWidget()'
collect2: ld returned 1 exit status
I've tried searching for a solution but all the solutions I can suggest altering a .pro file which I assume is something used by Netbeans or Codeblocks, neither of which I'm using.
What are the correct command line flags to pass to g++ so I can compile this application?
Here is the g++ command I'm currently using:
g++ *.cpp -I/usr/include/qt4 -I/usr/include/qt4/Qt -I/usr/include/QtCore -I/usr/include/QtGui -lGL
Edit: I ended up using a project file that looks like this.
TEMPLATE = app
TARGET = glQt
QT += opengl
HEADERS += \
GLWidget.h
SOURCES += \
GLWidget.cpp \
main.cpp
The .pro file is needed by QMake, the make app distributed with Qt.
This pro file specifies all the files needed to build your project, as well as the Qt modules.
More about qmake and the .pro file here: http://qt-project.org/doc/qt-4.8/qmake-manual.html
If you install the IDE QtCreator, the task of modifying the .pro file and compiling your app will be a bit easier.
After you modify the .pro file, you usually build the Qt app using the command qmake, which produces a make file ready to be used by your system (on Windows it can also produce .sln solutions for Visual Studio)
A short .pro file from one of my projects:
TEMPLATE = app
TARGET = icat2browser
QT += network webkit <-- add here the opengl module
DEFINES += QT_LARGEFILE_SUPPORT
HEADERS += \
qicat2networkaccessmanager.h \
ctimeline.h \
cobjectsview.h \
cicat2WebResponse.h \
cicat2usersdialog.h \
cicat2previewdialog.h \
cicat2login.h \
cicat2clients.h \
cicat2browser.h \
SOURCES += \
qicat2networkaccessmanager.cpp \
main.cpp \
ctimeline.cpp \
cobjectsview.cpp \
cicat2WebResponse.cpp \
cicat2usersdialog.cpp \
cicat2previewdialog.cpp \
cicat2login.cpp \
cicat2clients.cpp \
cicat2browser.cpp \
It looks like you are having a linker error. Although I have not used Qt, but from the way you compiling it looks like you are not linking Qt libraries. Try linking Qt libraries while building your example as follows (untested):
g++ *.cpp -I./ -I/usr/include/qt4 -I/usr/include/qt4/Qt -I/usr/include/QtCore -I/usr/include/QtGui -lGL -lQtCore -lQtGui -lQtOpenGL
I am guessing you must have installed development packages for Qt libraries in which case most likely you will have pkg-config files i.e. .pc files on you system in /usr/lib/pkgconfig. Try compiling as follows (untested):
g++ *.cpp -I./ `pkg-config --cflags --libs QtOpenGL`
Hope this helps!
I suggest you use qmake to generate a correct Makefile for your Qt installation. Using QtCreator simplifies this. Write a .pro file which is 5 lines of code and remember to add QT += opengl. Then run qmake and make.
I HIGHLY recommend you use qmake! Otherwise you will have to manually call the moc, uic, and rcc yourself!