Pjsip on CentOS 7 关于构建 CMake 项目的问题

Pjsip on CentOS 7 problems on building CMake project

我正在尝试使用 CMake 和 Qt IDE 在 Centos 7 上构建包含 Pjsip 库的 C++ 项目,但没有成功。我使用 readme.txt 中定义的步骤为 Centos 构建了 Pjsip:

./configure
make dep && make

配置 CMakeLists.txt 之后,配置如下:

cmake_minimum_required(VERSION 3.0)
set(CMAKE_INSTALL_PREFIX /opt)
project(hello-pjsip)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DSERVER_REMOTE_LOGGING -ggdb -Wno-unused-local-typedefs")

# Set the compilers as the default GCC for Centos 7 doesn't support all C++11 features
set(CMAKE_CXX_COMPILER /opt/rh/devtoolset-7/root/bin/g++)
set(CMAKE_C_COMPILER /opt/rh/devtoolset-7/root/bin/gcc)

# PJ library

include_directories(~/pjproject/pjlib/include)
link_directories(~/pjproject/pjlib/lib)

include_directories(~/pjproject/pjlib-util/include)
link_directories(~/pjproject/pjlib-util/lib)

include_directories(~/pjproject/pjnath/include)
include_directories(~/pjproject/pjnath/src)
link_directories(~/pjproject/pjnath/lib)

# Source files
set (SOURCE_FILES
      main.h
      main.cpp
    )

# Library files
set (LIBRARY_FILES 
     pj-x86_64-unknown-linux-gnu
     pjnath-x86_64-unknown-linux-gnu
     pjlib-util-x86_64-unknown-linux-gnu
    )

add_executable(hello-pjsip ${SOURCE_FILES})
target_link_libraries(hello-pjsip ${LIBRARY_FILES})

运行 构建后收到这些错误:

我尝试用不同的选项重新编译 pjsip 库但没有成功,每次都出现同样的错误。有人可以帮助我吗?

PJ 有 bug,5 个月前解决了。这解决了问题: https://trac.pjsip.org/repos/changeset/5599