OverviewV-Play Installationundefined reference to libpng12 on ubuntu 13.04 64bit › Reply To: undefined reference to libpng12 on ubuntu 13.04 64bit

OverviewV-Play Installationundefined reference to libpng12 on ubuntu 13.04 64bit › Reply To: undefined reference to libpng12 on ubuntu 13.04 64bit


I now modified the v-play.prf like so (additionally checking for linux-g++-64)

# Project file including V-Play libraries and paths for specific build target

# needed for reading the Mac address with QNetworkInterface, required for V-Play Game Network
QT += network

# Set gcc 4.6 on Linux machines
linux-g++|linux-g++-64 {
  QMAKE_CC = gcc-4.6
  QMAKE_CXX = g++-4.6

# Set SDK and base path
macx|win32|linux-g++|linux-g++-64: {
  # Paths for Windows Mac OS X, and Linux
} else: contains(MEEGO_EDITION,harmattan) {
  # Paths for MeeGo
  VPLAY_SDK_PATH = $$[QT_INSTALL_PREFIX]/../../../../Desktop/V-PlaySDK
} else: symbian: {
  # Paths for Symbian
  VPLAY_SDK_PATH = $$[QT_INSTALL_PREFIX]../../../Desktop/V-PlaySDK

# Resolve paths

# Check if the environment variable VPLAY_TEST_LOCALLY is set to 1
contains(TEST_LOCALLY, 1): {
    CONFIG += testLocally
    message(VPLAY_TEST_LOCALLY environment variable is set to 1)

# Only used for V-Play internal debugging
testLocally {
  message(testLocally config variable is set...)
  # $$_PRO_FILE_PWD_ must resolve to two subdirs underneath the main pro file, e.g. the demos/_demo_ folders
  # If the local feature file (v-play.prf) should be tested be sure to set QMAKEFEATURES env variable too (see README for this)

  linux-g++|linux-g++-64: VPLAY_LIBRARY_PATH = $$VPLAY_SDK_PATH/lib/linux
  symbian: VPLAY_LIBRARY_PATH = $$VPLAY_SDK_PATH/lib/symbian
  contains(MEEGO_EDITION,harmattan): VPLAY_LIBRARY_PATH = $$VPLAY_SDK_PATH/lib/meego
  win32: VPLAY_LIBRARY_PATH = $$VPLAY_SDK_PATH/lib/windows

# Set paths

# Add platform specific libraries
macx {
  # Frameworks
  LIBS += -framework Cocoa
  LIBS += -framework OpenGL
  LIBS += -framework OpenAL
  LIBS += -framework AudioToolbox

  # Third party libraries
  LIBS += -L$$VPLAY_LIBRARY_PATH/third_party -lcurl -lfreetype -ljpeg -lpng14 -lxml2 -lz

  # V-Play libraries
  CONFIG(release, debug|release): LIBS += -L$$VPLAY_LIBRARY_PATH -lVPlay
  else:CONFIG(debug, debug|release): LIBS += -L$$VPLAY_LIBRARY_PATH -lVPlay_debug

} else: win32 {
  # Third party libraries
  LIBS += -L$$VPLAY_LIBRARY_PATH/third_party -llibcurl_imp -llibEGL -llibgles_cm -llibiconv -llibjpeg -llibpng -llibxml2 -llibzlib -lpthreadVCE2
  LIBS += -lWinMM -lAdvAPI32 -lGdi32 -lshell32 -lUser32
  LIBS += -lkernel32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32

  # V-Play libraries
  CONFIG(release, debug|release): LIBS += -L$$VPLAY_LIBRARY_PATH -lVPlay
  else:CONFIG(debug, debug|release): LIBS += -L$$VPLAY_LIBRARY_PATH -lVPlayd

} else: symbian {
  # V-Play libraries
  CONFIG(release, debug|release): LIBS += -lVPlay
  CONFIG(debug, debug|release): LIBS += -lVPlay_debug
  # the below doesnt work, the library cat be found with the tools/checklib.exe
  #CONFIG(release, debug|release): LIBS += $$VPLAY_LIBRARY_PATH/VPlay.lib
  #else:CONFIG(debug, debug|release): LIBS += $$VPLAY_LIBRARY_PATH/VPlay_debug.lib

  # Third party libraries
  LIBS += -lusrt2_2.lib # (QTCREATORBUG-5589)
  # LIBS += -lcharconv

  # Symbian specific permissions
  TARGET.CAPABILITY += NetworkServices ReadUserData WriteUserData

  MMP_RULES += "OPTION gcce -march=armv6"
  MMP_RULES += "OPTION gcce -mfpu=vfp"
  MMP_RULES += "OPTION gcce -mfloat-abi=softfp"
  MMP_RULES += "OPTION gcce -marm"
  MMP_RULES += "OPTION gcce -fno-use-cxa-atexit"

  LIBS += -llibEGL -llibgles_cm
  LIBS += -lcone -leikcore -lavkon
  LIBS += -lremconcoreapi -lremconinterfacebase -lmmfdevsound

  QT += xml
  CONFIG += mobility
  MOBILITY += multimedia systeminfo sensors

} else: contains(MEEGO_EDITION,harmattan) {
  # V-Play libraries
  CONFIG(release, debug|release): LIBS += $$VPLAY_LIBRARY_PATH/libVPlay.a
  else:CONFIG(debug, debug|release): LIBS += $$VPLAY_LIBRARY_PATH/libVPlay_debug.a

  QT += meegographicssystemhelper
  LIBS += -lpthread -lxml2 -lEGL -lGLES_CM

  QT += xml
  CONFIG += mobility
  MOBILITY += multimedia systeminfo sensors

} else: linux-g++|linux-g++-64 {
  # V-Play libraries

  linux-g++:contains(QMAKE_HOST.arch, x86_64)|linux-g++-64: {
      LIBS += -lpng12 -lz -lfontconfig

  CONFIG(release, debug|release): LIBS += $$VPLAY_LIBRARY_PATH/libVPlay.a
  else:CONFIG(debug, debug|release): LIBS += $$VPLAY_LIBRARY_PATH/libVPlay_debug.a

  # Third party libraries

  message(V-Play 3rdparty library path: $$THIRDPARTY_LIBRARY_PATH)

  LIBS += -lglfw -lGL
  LIBS += -lcurl -lfreetype -ljpeg -lxml2

  linux-g++:contains(QMAKE_HOST.arch, x86_64)|linux-g++-64: {
    LIBS += -lfmodex64
  } else: {
    LIBS += -lfmodex

# QML Plugin paths = plugins
VPlayPluginsGenericFolder.source = $$VPLAY_SDK_PATH/plugins/generic
DEPLOYMENTFOLDERS += VPlayPluginsGenericFolder

contains(DEFINES, PLATFORM_WINDOWS): platformPluginPath = plugins/windows
else: contains(DEFINES, PLATFORM_MAC): platformPluginPath = plugins/macx
else: contains(DEFINES, PLATFORM_LINUX): platformPluginPath = plugins/linux
else: contains(DEFINES, PLATFORM_IOS): platformPluginPath = plugins/ios
else: contains(DEFINES, PLATFORM_ANDROID): platformPluginPath = plugins/android
else: contains(DEFINES, PLATFORM_SYMBIAN): platformPluginPath = plugins/symbian
else: contains(DEFINES, PLATFORM_MEEGO): platformPluginPath = plugins/meego = plugins
VPlayPluginsPlatformFolder.source = $$VPLAY_SDK_PATH/$$platformPluginPath
DEPLOYMENTFOLDERS += VPlayPluginsPlatformFolder

QML_IMPORT_PATH += $$VPlayPluginsPlatformFolder.source
QML_IMPORT_PATH += $$VPlayPluginsGenericFolder.source

# Mac deployment targets
macx {
  APPCERT = "3rd Party Mac Developer Application: $${COMPANY}"
  INSTALLERCERT = "3rd Party Mac Developer Installer: $${COMPANY}"


  # Adapt paths for shadow builds


  # package target, creates standalone .app package
  package.depends += all first copydeploymentfolders
  package.commands += $$[QT_INSTALL_PREFIX]/bin/macdeployqt $${TARGET}.app;
  # Remove unneeded frameworks and plug-ins
  # package.commands += rm -r $${TARGET}.app/Contents/Frameworks/QtDeclarative.framework;
  package.commands += rm -r $${TARGET}.app/Contents/PlugIns/accessible;
  package.commands += rm -r $${TARGET}.app/Contents/PlugIns/bearer;
  package.commands += find $${TARGET}.app -name '*.DS_Store' -type f -delete;
  package.commands += chmod -R a+xr $${TARGET}.app

  # codesign target, creates dSym file and signs package from package step
  codesign.depends += package
  codesign.commands += dsymutil $${TARGET}.app/Contents/MacOS/$${TARGET} -o $${TARGET}.app.dSYM;
  # Sign frameworks and plug-ins (should be done in future?)
  # codesign -s "$APPCERT" -i $BUNDLEID $${TARGET}.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore
  # codesign -s "$APPCERT" -i $BUNDLEID $${TARGET}.app/Contents/PlugIns/imageformats/libqjpeg.dylib
  # Sign the application bundle, using the provided entitlements
  codesign.commands += codesign -s \"$${APPCERT}\" -fv --entitlements $${ENTITLEMENTS} $${TARGET}.app;

  # mas target, create an installer file for mac app store, combining the other targets
  mas.depends += package codesign
  mas.commands += productbuild --component $${TARGET}.app /Applications --sign \"$${INSTALLERCERT}\" $${TARGET}.pkg;

  QMAKE_EXTRA_TARGETS += package codesign mas copyfiles

# Print paths for debug purposes and support requests
message(QT install prefix: $$QT_INSTALL_PREFIX)
message(V-Play SDK path: $$VPLAY_SDK_PATH)
message(V-Play target path: $$VPLAY_BASE_PATH)
message(V-Play library path: $$VPLAY_LIBRARY_PATH)
message(V-Play qml path: $$VPLAY_QML_PATH)
message(V-Play include path: $$VPLAY_INCLUDE_PATH)
message(VPlayPluginsGenericPath: $$VPlayPluginsGenericFolder.source)
message(VPlayPluginsPlatformPath: $$VPlayPluginsPlatformFolder.source)

# Please do not modify the following two lines. Required for deployment.

which brings up the known linker error

g++-4.6 -m64 -Wl,-rpath,/home/eigel/libs/V-PlaySDK/Desktop/Qt/4.8.1/gcc/lib -o MultiDragAndPinch main.o qmlapplicationviewer.o moc_qmlapplicationviewer.o    -L/home/eigel/libs/V-PlaySDK/Desktop/Qt/4.8.1/gcc/lib -lpng12 -lz -lfontconfig /home/eigel/libs/V-PlaySDK/Desktop/Qt/4.8.1/gcc/../../../V-PlaySDK/lib/lib64/libVPlay_debug.a -L/home/eigel/libs/V-PlaySDK/Desktop/Qt/4.8.1/gcc/../../../V-PlaySDK/lib/lib64/third_party -lglfw -lGL -lcurl -lfreetype -ljpeg -lxml2 -lfmodex64 -lQtDeclarative -L/home/eigel/libs/V-PlaySDK/Desktop/Qt/4.8.1/gcc/lib -lQtScript -lQtSvg -L/usr/X11R6/lib64 -lQtSql -lQtXmlPatterns -lQtGui -lQtNetwork -lQtCore -lpthread 
/usr/bin/ld: /home/eigel/libs/V-PlaySDK/Desktop/Qt/4.8.1/gcc/../../../V-PlaySDK/lib/lib64/libVPlay_debug.a(CCImage.o): undefined reference to symbol 'png_malloc@@PNG12_0'
/usr/bin/ld: note: 'png_malloc@@PNG12_0' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/ so try adding it to the linker command line
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/ could not read symbols: Invalid operation
collect2: ld returned 1 exit status

I also have a fresh ubuntu 13.04 64 installation so we should have identical library files. Not sure how to compare though.

eigel@hilbert:~$ ls -la /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/
lrwxrwxrwx 1 root root 35 Nov 12  2012 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/ -> /lib/x86_64-linux-gnu/
eigel@hilbert:~$ ls -la /lib/x86_64-linux-gnu/
lrwxrwxrwx 1 root root 18 Nov 12  2012 /lib/x86_64-linux-gnu/ ->
eigel@hilbert:~$ ls -la /lib/x86_64-linux-gnu/ 
-rw-r--r-- 1 root root 153944 Nov 12  2012 /lib/x86_64-linux-gnu/
eigel@hilbert:~$ ldd /lib/x86_64-linux-gnu/ =>  (0x00007ffffc5ca000) => /lib/x86_64-linux-gnu/ (0x00007f7ce5495000) => /lib/x86_64-linux-gnu/ (0x00007f7ce5190000) => /lib/x86_64-linux-gnu/ (0x00007f7ce4dc7000)
	/lib64/ (0x00007f7ce58f3000)
eigel@hilbert:~$ nm -D /lib/x86_64-linux-gnu/ 
                 U abort
                 U crc32
                 w __cxa_finalize
                 U deflate
                 U deflateEnd
                 U deflateInit2_
                 U deflateReset
                 U fflush
                 U __fprintf_chk
                 U fputc
                 U fread
                 U free
                 U fwrite
                 w __gmon_start__
                 U gmtime
                 U inflate
                 U inflateEnd
                 U inflateInit_
                 U inflateReset
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w _Jv_RegisterClasses
                 U __longjmp_chk
                 U malloc
                 U memcmp
                 U memcpy
                 U __memcpy_chk
                 U memset
0000000000000000 A PNG12_0
0000000000004a70 T png_access_version_number
0000000000016ef0 T png_build_grayscale_palette
0000000000003f00 T png_check_sig
000000000001beb0 T png_chunk_error
000000000001bf10 T png_chunk_warning
00000000000132a0 T png_convert_from_struct_tm
00000000000132d0 T png_convert_from_time_t
0000000000004850 T png_convert_to_rfc1123
0000000000004120 T png_create_info_struct
00000000000106e0 T png_create_read_struct
00000000000102e0 T png_create_read_struct_2
0000000000014850 T png_create_write_struct
0000000000014560 T png_create_write_struct_2
0000000000004180 T png_data_freer
00000000000047b0 T png_destroy_info_struct
00000000000123c0 T png_destroy_read_struct
0000000000013a80 T png_destroy_write_struct
000000000001bb50 T png_error
000000000001b960 T png_free
00000000000041c0 T png_free_data
000000000001b940 T png_free_default
00000000000075d0 T png_get_asm_flagmask
00000000000075c0 T png_get_asm_flags
0000000000006ac0 T png_get_bit_depth
0000000000006d80 T png_get_bKGD
0000000000006d40 T png_get_channels
0000000000006db0 T png_get_cHRM
0000000000006ec0 T png_get_cHRM_fixed
0000000000006ae0 T png_get_color_type
00000000000075a0 T png_get_compression_buffer_size
0000000000006b40 T png_get_compression_type
0000000000004990 T png_get_copyright
000000000001bf90 T png_get_error_ptr
0000000000006b00 T png_get_filter_type
0000000000006fa0 T png_get_gAMA
0000000000006fe0 T png_get_gAMA_fixed
00000000000049b0 T png_get_header_ver
00000000000049c0 T png_get_header_version
00000000000070e0 T png_get_hIST
0000000000007050 T png_get_iCCP
0000000000007120 T png_get_IHDR
0000000000006aa0 T png_get_image_height
0000000000006a80 T png_get_image_width
0000000000007870 T png_get_int_32
0000000000006b20 T png_get_interlace_type
0000000000004820 T png_get_io_ptr
00000000000049a0 T png_get_libpng_ver
000000000001ba40 T png_get_mem_ptr
00000000000075f0 T png_get_mmx_bitdepth_threshold
00000000000075e0 T png_get_mmx_flagmask
0000000000007600 T png_get_mmx_rowbytes_threshold
00000000000071f0 T png_get_oFFs
0000000000007250 T png_get_pCAL
0000000000007360 T png_get_pHYs
0000000000006c00 T png_get_pixel_aspect_ratio
0000000000006bc0 T png_get_pixels_per_meter
00000000000073c0 T png_get_PLTE
000000000001d930 T png_get_progressive_ptr
0000000000007560 T png_get_rgb_to_gray_status
0000000000006a40 T png_get_rowbytes
0000000000006a60 T png_get_rows
0000000000007400 T png_get_sBIT
0000000000007310 T png_get_sCAL
0000000000006d60 T png_get_signature
00000000000070b0 T png_get_sPLT
0000000000007020 T png_get_sRGB
0000000000007430 T png_get_text
0000000000007480 T png_get_tIME
00000000000074b0 T png_get_tRNS
00000000000078a0 T png_get_uint_16
0000000000007800 T png_get_uint_31
0000000000007840 T png_get_uint_32
0000000000007530 T png_get_unknown_chunks
0000000000007580 T png_get_user_chunk_ptr
0000000000007630 T png_get_user_height_max
000000000000c330 T png_get_user_transform_ptr
0000000000007610 T png_get_user_width_max
0000000000006a20 T png_get_valid
0000000000006c80 T png_get_x_offset_microns
0000000000006ce0 T png_get_x_offset_pixels
0000000000006b60 T png_get_x_pixels_per_meter
0000000000006cb0 T png_get_y_offset_microns
0000000000006d10 T png_get_y_offset_pixels
0000000000006b90 T png_get_y_pixels_per_meter
00000000000049d0 T png_handle_as_unknown
0000000000004100 T png_info_init
0000000000004010 T png_info_init_3
0000000000004840 T png_init_io
000000000001df10 R png_libpng_ver
000000000001b890 T png_malloc
000000000001b870 T png_malloc_default
000000000001b9a0 T png_malloc_warn
000000000001ba00 T png_memcpy_check
000000000001ba10 T png_memset_check
0000000000004a80 T png_mmx_support
000000000001de40 R png_pass_dsp_mask
000000000001dec0 R png_pass_inc
000000000001de60 R png_pass_mask
000000000001dee0 R png_pass_start
000000000001de80 R png_pass_yinc
000000000001dea0 R png_pass_ystart
00000000000066f0 T png_permit_empty_plte
0000000000006720 T png_permit_mng_features
000000000001d860 T png_process_data
000000000001d8c0 T png_progressive_combine_row
0000000000011f90 T png_read_destroy
0000000000011a30 T png_read_end
00000000000119b0 T png_read_image
0000000000010c10 T png_read_info
0000000000012510 T png_read_png
00000000000112d0 T png_read_row
00000000000118f0 T png_read_rows
0000000000011240 T png_read_update_info
0000000000004a50 T png_reset_zstream
000000000000c710 T png_save_int_32
000000000000c740 T png_save_uint_16
000000000000c6e0 T png_save_uint_32
000000000000bd90 T png_set_add_alpha
00000000000069d0 T png_set_asm_flags
0000000000014ca0 T png_set_background
000000000000bc50 T png_set_bgr
00000000000051d0 T png_set_bKGD
0000000000005200 T png_set_cHRM
0000000000005370 T png_set_cHRM_fixed
0000000000006940 T png_set_compression_buffer_size
0000000000014870 T png_set_compression_level
0000000000014890 T png_set_compression_mem_level
0000000000014960 T png_set_compression_method
00000000000148b0 T png_set_compression_strategy
00000000000148d0 T png_set_compression_window_bits
0000000000014b80 T png_set_crc_action
0000000000014d50 T png_set_dither
000000000001bf70 T png_set_error_fn
00000000000156a0 T png_set_expand
00000000000156e0 T png_set_expand_gray_1_2_4_to_8
000000000000bd20 T png_set_filler
0000000000013b90 T png_set_filter
0000000000013e10 T png_set_filter_heuristics
00000000000136d0 T png_set_flush
0000000000005530 T png_set_gAMA
00000000000055d0 T png_set_gAMA_fixed
0000000000015620 T png_set_gamma
0000000000015700 T png_set_gray_1_2_4_to_8
0000000000015740 T png_set_gray_to_rgb
00000000000056c0 T png_set_hIST
0000000000005d70 T png_set_iCCP
0000000000005770 T png_set_IHDR
000000000000bcf0 T png_set_interlace_handling
00000000000069b0 T png_set_invalid
000000000000bdd0 T png_set_invert_alpha
000000000000bdf0 T png_set_invert_mono
0000000000006740 T png_set_keep_unknown_chunks
000000000001ba20 T png_set_mem_fn
00000000000069f0 T png_set_mmx_thresholds
0000000000005890 T png_set_oFFs
000000000000bc80 T png_set_packing
000000000000bca0 T png_set_packswap
00000000000156c0 T png_set_palette_to_rgb
00000000000058c0 T png_set_pCAL
0000000000005b00 T png_set_pHYs
0000000000005b30 T png_set_PLTE
000000000001d8f0 T png_set_progressive_read_fn
0000000000012870 T png_set_read_fn
0000000000012500 T png_set_read_status_fn
00000000000068c0 T png_set_read_user_chunk_fn
0000000000015990 T png_set_read_user_transform_fn
00000000000158c0 T png_set_rgb_to_gray
0000000000015760 T png_set_rgb_to_gray_fixed
00000000000068e0 T png_set_rows
0000000000005c20 T png_set_sBIT
0000000000005ad0 T png_set_sCAL
000000000000bcc0 T png_set_shift
0000000000003e00 T png_set_sig_bytes
00000000000062e0 T png_set_sPLT
0000000000005c50 T png_set_sRGB
0000000000005c70 T png_set_sRGB_gAMA_and_cHRM
0000000000014d10 T png_set_strip_16
0000000000014d30 T png_set_strip_alpha
000000000001bfb0 T png_set_strip_error_numbers
000000000000bc60 T png_set_swap
000000000000bdb0 T png_set_swap_alpha
0000000000006120 T png_set_text
0000000000006140 T png_set_tIME
0000000000006170 T png_set_tRNS
0000000000015720 T png_set_tRNS_to_alpha
00000000000066c0 T png_set_unknown_chunk_location
00000000000064e0 T png_set_unknown_chunks
0000000000006a00 T png_set_user_limits
000000000000c310 T png_set_user_transform_info
00000000000129a0 T png_set_write_fn
00000000000149b0 T png_set_write_status_fn
00000000000149c0 T png_set_write_user_transform_fn
0000000000003e50 T png_sig_cmp
00000000000112b0 T png_start_read_image
000000000001bd60 T png_warning
000000000000ca10 T png_write_chunk
000000000000c870 T png_write_chunk_data
000000000000c9b0 T png_write_chunk_end
000000000000c7e0 T png_write_chunk_start
0000000000013800 T png_write_destroy
00000000000130c0 T png_write_end
00000000000136f0 T png_write_flush
0000000000013610 T png_write_image
0000000000012cb0 T png_write_info
0000000000012a30 T png_write_info_before_PLTE
00000000000149e0 T png_write_png
0000000000013300 T png_write_row
0000000000013680 T png_write_rows
                 U pow
                 U _setjmp
                 U __snprintf_chk
                 U __stack_chk_fail
                 U stderr
                 U strlen
                 U strtod
eigel@hilbert:~$ nm -g /lib/x86_64-linux-gnu/ 
nm: /lib/x86_64-linux-gnu/ no symbols

Not sure if the last line points to a problem? Do you have any suggestions?

Best, Martin

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support