How do I link external shared library with my source

Hi All.

I'm developer for Internet of Things.

Now, I'm testing AllJoyn Framework (IoT Connectivity Framework) with Clion.

First, I compile AllJoyn Lib with Scons(AllJoyn Default Build Tool) -> Output file is header(.h) and shared library(.so) file.

Second, I make AllJoyn sample App with CLion.


[My CmakeLists.txt File]

cmake_minimum_required(VERSION 3.3)


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")



set(SOURCE_FILES main.cpp)

add_executable(AllJoyn_Test ${SOURCE_FILES})


But, I don't know How do Link shared Library file(

Plz give me your help.

1 comment
Comment actions Permalink

Hi JongWoon.

Sorry for the delay! Please try using target_link_library command.


Please sign in to leave a comment.