我正在尝试使用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})
运行build后收到这些错误:
我尝试用不同的选项重新编译pjsip库但没有成功,每次都有相同的错误。有人能帮助我吗?