Skip to content

FindPJSIP doesn't link the PJSIP libraries (or am I wrong?) #9

@MustacheAgent

Description

@MustacheAgent

I am using CLion with CMake project and PJSIP libraries on Linux Debian. I downloaded FindPJSIP.cmake from this repo, placed it in my project directory, and then modified CMakeLists.txt as written in readme.md. CMake tells me that all libs are found, but when building this project I encounter a lot of "undefined references". Here is CMakeLists.txt:

cmake_minimum_required(VERSION 3.17)
project(Transmitter)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeHelpers")

find_package(PJSIP REQUIRED)

if (NOT PJSIP_FOUND)
    message(SEND_ERROR "PJSIP not found")
    return()
else()
    include_directories(${PJSIP_INCLUDE_DIRS})
    link_directories(${PJSIP_LIBRARY_DIRS})
endif()

add_executable(${PROJECT_NAME} main.cpp)

target_include_directories(${PROJECT_NAME} ${PJSIP_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PJSIP_LIBRARIES})

And there are errors (lots and lots of them, about hundred or even more).
изображение

Maybe I am doing it wrong? Because I made this project previously in QT Creator using qmake and it worked fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions