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)

project(AllJoyn_Test)

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

include_directories(../AJ_Lib/15.09a/cpp/inc)

add_definitions(-DQCC_OS_LINUX -DQCC_OS_GROUP_POSIX)

set(SOURCE_FILES main.cpp)

add_executable(AllJoyn_Test ${SOURCE_FILES})

 

But, I don't know How do Link shared Library file(liballjoyn.so)...

Plz give me your help.

1 comment

Hi JongWoon.

Sorry for the delay! Please try using target_link_library command.

0

Please sign in to leave a comment.