首先让我来看看我的CMakeLists.txt来源:
cmake_minimum_required(VERSION 2.8.7)
project(audiowaveform)
#set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: default is Release")
endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
message(STATUS "CMAKE_VERSION=${CMAKE_VERSION}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
set(CMAKE_MODULE_PATH "${audiowaveform_SOURCE_DIR}/cmake/modules")
message(STATUS "CMAKE_MODULE_PATH='${CMAKE_MODULE_PATH}'")
include(SystemInfo)
#-------------------------------------------------------------------------------
#
# Version number
#
#-------------------------------------------------------------------------------
# Read version number from VERSION file and split into its component parts.
file(STRINGS "VERSION" VERSION)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" VERSION_PARTS ${VERSION})
set(VERSION_MAJOR ${CMAKE_MATCH_1})
set(VERSION_MINOR ${CMAKE_MATCH_2})
set(VERSION_PATCH ${CMAKE_MATCH_3})
message(STATUS "Building version ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
#-------------------------------------------------------------------------------
#
# Dependencies
#
#-------------------------------------------------------------------------------
find_package(LibGD REQUIRED)
if(LIBGD_FOUND)
message(STATUS "LIBGD_INCLUDE_DIR='${LIBGD_INCLUDE_DIR}'")
message(STATUS "LIBGD_LIBRARY=${LIBGD_LIBRARY}")
include_directories(${LIBGD_INCLUDE_DIR})
endif(LIBGD_FOUND)
find_package(LibSndFile REQUIRED)
if(LIBSNDFILE_FOUND)
message(STATUS "LIBSNDFILE_INCLUDE_DIR='${LIBSNDFILE_INCLUDE_DIR}'")
message(STATUS "LIBSNDFILE_LIBRARY=${LIBSNDFILE_LIBRARY}")
include_directories(${LIBSNDFILE_INCLUDE_DIR})
endif(LIBSNDFILE_FOUND)
find_package(LibMad REQUIRED)
if(LIBMAD_FOUND)
message(STATUS "LIBMAD_INCLUDE_DIR='${LIBMAD_INCLUDE_DIR}'")
message(STATUS "LIBMAD_LIBRARY=${LIBMAD_LIBRARY}")
include_directories(${LIBMAD_INCLUDE_DIR})
endif(LIBMAD_FOUND)
find_package(LibId3Tag REQUIRED)
if(LIBID3TAG_FOUND)
message(STATUS "LIBID3TAG_INCLUDE_DIR='${LIBID3TAG_INCLUDE_DIR}'")
message(STATUS "LIBID3TAG_LIBRARY=${LIBID3TAG_LIBRARY}")
include_directories(${LIBID3TAG_INCLUDE_DIR})
endif(LIBID3TAG_FOUND)
add_definitions( -DBOOST_ALL_NO_LIB )
set(Boost_USE_STATIC_LIBS ON)
unset(Boost_INCLUDE_DIR CACHE)
unset(Boost_LIBRARY_DIRS CACHE)
find_package(Boost 1.46.0 COMPONENTS program_options filesystem regex system REQUIRED)
if(Boost_FOUND)
message(STATUS "Boost_INCLUDE_DIRS='${Boost_INCLUDE_DIRS}'")
message(STATUS "Boost_LIBRARIES='${Boost_LIBRARIES}'")
include_directories(${Boost_INCLUDE_DIRS})
endif(Boost_FOUND)
#-------------------------------------------------------------------------------
#
# Packaging
#
#-------------------------------------------------------------------------------
set(CPACK_PACKAGE_NAME "audiowaveform")
set(CPACK_PACKAGE_VENDOR "Chris Needham")
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_CONTACT "Chris Needham <chris@chrisneedham.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Audio waveform data and image generator")
set(CPACK_PACKAGE_DESCRIPTION "Generates audio waveform data that can be used to render waveform images, similar to Audacity")
set(CPACK_RESOURCE_FILE_LICENSE "${audiowaveform_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${audiowaveform_SOURCE_DIR}/README.md")
set(PACKAGE_RELEASE_NUMBER 1)
if(UNIX AND NOT APPLE AND NOT CYGWIN)
if(OF_DISTRO_IS_UBUNTU)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_SECTION "sound")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${OF_SYSTEM_ARCH}")
set(PACKAGE_BOOST_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libmad0 (>=0.15.1), libsndfile1 (>= 1.0.25), libgd2-xpm (>= 2.0.35), libboost-program-options${PACKAGE_BOOST_VERSION}, libboost-filesystem${PACKAGE_BOOST_VERSION}, libboost-regex${PACKAGE_BOOST_VERSION}")
# http://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html#s-pkgname
# The Debian binary package file names conform to the following convention:
# <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${PACKAGE_RELEASE_NUMBER}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
endif()
if(OF_DISTRO_IS_CENTOS OR OF_DISTRO_IS_FEDORA)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Multimedia")
set(CPACK_RPM_PACKAGE_ARCHITECTURE "${OF_SYSTEM_ARCH}")
set(CPACK_RPM_PACKAGE_REQUIRES "libmad >= 0.15.1, libsndfile >= 1.0.25, gd >= 2.0.35, boost >= ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${PACKAGE_RELEASE_NUMBER}.${OF_SYSTEM_ARCH}")
endif()
endif()
include(CPack)
#-------------------------------------------------------------------------------
#
# Compiler flags
#
#-------------------------------------------------------------------------------
if(CMAKE_VERSION VERSION_LESS "2.8.10")
exec_program(
${CMAKE_CXX_COMPILER}
ARGS --version
OUTPUT_VARIABLE COMPILER_VERSION_STRING
)
string(REGEX REPLACE ".*([0-9]\\.[0-9]\\.[0-9]).*" "\\1" CMAKE_CXX_COMPILER_VERSION ${COMPILER_VERSION_STRING})
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.6.3")
message(FATAL_ERROR "g++ 4.6.3 or later required")
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7")
set(CMAKE_CXX_FLAGS "-std=c++11")
else()
# Set GTEST_LANG_CXX11=0 to disable C++11 features when compiling googlemock.
# Without this compilation fails with g++ 4.6.3 on gmock-matchers.h.
set(CMAKE_CXX_FLAGS "-std=c++0x -DGTEST_LANG_CXX11=0")
endif()
set(COMMON_FLAGS "-Wall -Wextra -Wconversion -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -DBOOST_FILESYSTEM_NO_DEPRECATED")
set(CMAKE_C_FLAGS ${COMMON_FLAGS})
if(APPLE)
set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
endif()
message(STATUS "CMAKE_CXX_COMPILER_VERSION='${CMAKE_CXX_COMPILER_VERSION}'")
message(STATUS "CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'")
message(STATUS "CMAKE_CXX_FLAGS_DEBUG='${CMAKE_CXX_FLAGS_DEBUG}'")
message(STATUS "CMAKE_CXX_FLAGS_RELEASE='${CMAKE_CXX_FLAGS_RELEASE}'")
message(STATUS "CMAKE_CXX_COMPILE_OBJECT='${CMAKE_CXX_COMPILE_OBJECT}'")
#-------------------------------------------------------------------------------
#
# Source files
#
#-------------------------------------------------------------------------------
include_directories(src)
# Configure a header file to pass some of the CMake settings to the source code.
configure_file(
"${PROJECT_SOURCE_DIR}/src/Config.h.in"
"${PROJECT_BINARY_DIR}/Config.h"
)
# Add the binary directory to the search path for include files so that we find
# Config.h.
include_directories("${PROJECT_BINARY_DIR}")
set(MODULES
src/AudioFileReader.cpp
src/AudioProcessor.cpp
src/BStdFile.cpp
src/Error.cpp
src/GdImageRenderer.cpp
src/MathUtil.cpp
src/Mp3AudioFileReader.cpp
src/Options.cpp
src/OptionHandler.cpp
src/Rgba.cpp
src/SndFileAudioFileReader.cpp
src/TimeUtil.cpp
src/WaveformBuffer.cpp
src/WaveformColors.cpp
src/WaveformGenerator.cpp
src/WaveformRescaler.cpp
src/WavFileWriter.cpp
src/madlld-1.1p1/bstdfile.c
)
set(SRCS
src/Main.cpp
${MODULES}
)
add_executable(audiowaveform ${SRCS})
#-------------------------------------------------------------------------------
#
# Linker
#
#-------------------------------------------------------------------------------
# Specify libraries to link against.
set(LIBS ${LIBSNDFILE_LIBRARY} ${LIBMAD_LIBRARY} ${LIBID3TAG_LIBRARY} ${Boost_LIBRARIES} ) #${ZLIB_LIBRARIES}
target_link_libraries(audiowaveform ${LIBS} )
target_link_libraries(audiowaveform ${LIBGD_LIBRARY} )
#-------------------------------------------------------------------------------
#
# Tests
#
#-------------------------------------------------------------------------------
if (NOT DEFINED ENABLE_TESTS)
set(ENABLE_TESTS 0)
endif()
if(ENABLE_TESTS)
enable_testing()
# Use EXCLUDE_FROM_ALL to prevent installing googletest headers as part of
# 'make install'.
add_subdirectory(googlemock EXCLUDE_FROM_ALL)
set(TESTS
test/AudioFileReaderTest.cpp
test/GdImageRendererTest.cpp
test/MathUtilTest.cpp
test/Mp3AudioFileReaderTest.cpp
test/OptionsTest.cpp
test/OptionHandlerTest.cpp
test/RgbaTest.cpp
test/SndFileAudioFileReaderTest.cpp
test/TimeUtilTest.cpp
test/WavFileWriterTest.cpp
test/WaveformBufferTest.cpp
test/WaveformGeneratorTest.cpp
test/WaveformRescalerTest.cpp
test/util/FileDeleter.cpp
test/util/FileUtil.cpp
test/util/Streams.cpp
)
include_directories(${gtest_SOURCE_DIR}/include ${gmock_SOURCE_DIR}/include)
set(TEST_LIBS gmock_main)
add_executable(audiowaveform_tests ${MODULES} ${TESTS})
target_link_libraries(audiowaveform_tests ${LIBS} ${TEST_LIBS})
add_test(audiowaveform_tests audiowaveform_tests)
else()
message(STATUS "Unit tests disabled")
endif()
#-------------------------------------------------------------------------------
#
# Documentation
#
#-------------------------------------------------------------------------------
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/doc/audiowaveform.1.gz
COMMAND gzip -c -9 ${PROJECT_SOURCE_DIR}/doc/audiowaveform.1 > ${PROJECT_BINARY_DIR}/doc/audiowaveform.1.gz
DEPENDS ${PROJECT_SOURCE_DIR}/doc/audiowaveform.1
)
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/doc/audiowaveform.5.gz
COMMAND gzip -c -9 ${PROJECT_SOURCE_DIR}/doc/audiowaveform.5 > ${PROJECT_BINARY_DIR}/doc/audiowaveform.5.gz
DEPENDS ${PROJECT_SOURCE_DIR}/doc/audiowaveform.5
)
add_custom_target(doc
DEPENDS ${PROJECT_BINARY_DIR}/doc/audiowaveform.1.gz
${PROJECT_BINARY_DIR}/doc/audiowaveform.5.gz
)
add_dependencies(audiowaveform doc)
#-------------------------------------------------------------------------------
#
# Installation
#
#-------------------------------------------------------------------------------
message(STATUS "CMAKE_INSTALL_PREFIX='${CMAKE_INSTALL_PREFIX}'")
# Install executable
install(TARGETS audiowaveform DESTINATION bin)
# Install man pages
install(
FILES ${PROJECT_BINARY_DIR}/doc/audiowaveform.1.gz
DESTINATION share/man/man1
)
install(
FILES ${PROJECT_BINARY_DIR}/doc/audiowaveform.5.gz
DESTINATION share/man/man5
)
#-------------------------------------------------------------------------------
现在这是我运行cmake
时的消息:
The C compiler identification is GNU 5.4.1
The CXX compiler identification is GNU 5.4.1
Check for working C compiler: /usr/bin/cc
Check for working C compiler: /usr/bin/cc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: /usr/bin/c++
Check for working CXX compiler: /usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Build type not specified: default is Release
CMAKE_VERSION=3.5.2
Build type: Release
CMAKE_MODULE_PATH='/home/medo/build2/audiowaveform-master/cmake/modules'
Building version 1.1.0
Found LibGD: /usr/local/lib/libgd.a
LIBGD_INCLUDE_DIR='/usr/local/include'
LIBGD_LIBRARY=/usr/local/lib/libgd.a
Found LibSndFile: /usr/local/lib/libsndfile.a
LIBSNDFILE_INCLUDE_DIR='/usr/local/include'
LIBSNDFILE_LIBRARY=/usr/local/lib/libsndfile.a
Found LibMad: /usr/local/lib/libmad.a
LIBMAD_INCLUDE_DIR='/usr/local/include'
LIBMAD_LIBRARY=/usr/local/lib/libmad.a
Found LibId3Tag: /usr/local/lib/libid3tag.a
LIBID3TAG_INCLUDE_DIR='/usr/local/include'
LIBID3TAG_LIBRARY=/usr/local/lib/libid3tag.a
Boost version: 1.58.0
Found the following Boost libraries:
program_options
filesystem
regex
system
Boost_INCLUDE_DIRS='/usr/include'
Boost_LIBRARIES='/usr/lib/x86_64-linux-gnu/libboost_program_options.a;/usr/lib/x86_64-linux-gnu/libboost_filesystem.a;/usr/lib/x86_64-linux-gnu/libboost_regex.a;/usr/lib/x86_64-linux-gnu/libboost_system.a'
CMAKE_CXX_COMPILER_VERSION='5.4.1'
CMAKE_CXX_FLAGS='-std=c++11 -Wall -Wextra -Wconversion -pedantic -DBOOST_FILESYSTEM_NO_DEPRECATED'
CMAKE_CXX_FLAGS_DEBUG='-g'
CMAKE_CXX_FLAGS_RELEASE='-O3 -DNDEBUG'
CMAKE_CXX_COMPILE_OBJECT='<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>'
Unit tests disabled
CMAKE_INSTALL_PREFIX='/usr/local'
Configuring done
Generating done
现在我进入构建文件夹并运行make
命令
当进度100%时,它给我一个错误
[100%] Linking CXX executable audiowaveform
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `sf_flac_error_callback':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:520: undefined reference to `FLAC__StreamDecoderErrorStatusString'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_seek':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:1391: undefined reference to `FLAC__stream_decoder_seek_absolute'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_close':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:736: undefined reference to `FLAC__metadata_object_delete'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:739: undefined reference to `FLAC__stream_encoder_finish'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:740: undefined reference to `FLAC__stream_encoder_delete'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:745: undefined reference to `FLAC__stream_decoder_finish'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:746: undefined reference to `FLAC__stream_decoder_delete'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_strings':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:627: undefined reference to `FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:628: undefined reference to `FLAC__metadata_object_vorbiscomment_append_comment'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:631: undefined reference to `FLAC__stream_encoder_set_metadata'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_header':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:646: undefined reference to `FLAC__stream_encoder_init_stream'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:647: undefined reference to `FLAC__StreamEncoderInitStatusString'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_strings':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:582: undefined reference to `FLAC__metadata_object_new'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `sf_flac_meta_get_vorbiscomments':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:414: undefined reference to `FLAC__metadata_object_vorbiscomment_find_entry_from'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_enc_init':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:792: undefined reference to `FLAC__stream_encoder_delete'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:793: undefined reference to `FLAC__stream_encoder_new'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:796: undefined reference to `FLAC__stream_encoder_set_channels'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:801: undefined reference to `FLAC__stream_encoder_set_sample_rate'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:806: undefined reference to `FLAC__stream_encoder_set_bits_per_sample'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:811: undefined reference to `FLAC__stream_encoder_set_compression_level'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_d2flac':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:1272: undefined reference to `FLAC__stream_encoder_process_interleaved'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_f2flac':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:1141: undefined reference to `FLAC__stream_encoder_process_interleaved'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_i2flac':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:1099: undefined reference to `FLAC__stream_encoder_process_interleaved'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_write_s2flac':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:1057: undefined reference to `FLAC__stream_encoder_process_interleaved'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_read_loop':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:919: undefined reference to `FLAC__stream_decoder_get_state'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:932: undefined reference to `FLAC__stream_decoder_process_single'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:934: undefined reference to `FLAC__stream_decoder_get_state'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:936: undefined reference to `FLAC__StreamDecoderStateString'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:921: undefined reference to `FLAC__StreamDecoderStateString'
/usr/local/lib/libsndfile.a(libsndfile_la-flac.o): In function `flac_read_header':
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:825: undefined reference to `FLAC__stream_decoder_delete'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:826: undefined reference to `FLAC__stream_decoder_new'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:829: undefined reference to `FLAC__stream_decoder_set_metadata_respond_all'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:831: undefined reference to `FLAC__stream_decoder_init_stream'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:834: undefined reference to `FLAC__stream_decoder_process_until_end_of_metadata'
/home/medo/build2/lib/libsndfile-1.0.28/src/flac.c:841: undefined reference to `FLAC__stream_decoder_get_decode_position'
/usr/local/lib/libsndfile.a(ogg.o): In function `ogg_close':
/home/medo/build2/lib/libsndfile-1.0.28/src/ogg.c:103: undefined reference to `ogg_sync_clear'
/home/medo/build2/lib/libgd-2.2.5/src/gd_png.c:328: undefined reference to `png_get_valid'
/home/medo/build2/lib/libgd-2.2.5/src/gd_png.c:336: undefined reference to `png_get_tRNS'
/home/medo/build2/lib/libgd-2.2.5/src/gd_png.c:311: undefined reference to `png_get_pHYs'
/home/medo/build2/lib/libgd-2.2.5/src/gd_png.c:292: undefined reference to `png_set_strip_16'
/home/medo/build2/lib/libgd-2.2.5/src/gd_png.c:396: undefined reference to `png_get_tRNS'
/usr/local/lib/libgd.a(gd_png.o): In function `gdPngReadData':
/home/medo/build2/lib/libgd-2.2.5/src/gd_png.c:89: undefined reference to `png_error'
collect2: error: ld returned 1 exit status
CMakeFiles/audiowaveform.dir/build.make:570: recipe for target 'audiowaveform' failed
make[2]: *** [audiowaveform] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/audiowaveform.dir/all' failed
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
我不知道发生了什么。所有的库都链接在一起,最后它给了我这个错误。有没有人有任何想法?