Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 17:37:37 +0000



Post From: Python for Sierra Chart

[2022-01-18 02:39:21]
User155017 - Posts: 41
After many efforts I managed to compile in linux, modifying the make file.
The built of dtcpy is successful, but the only think which resembles it is dtcpy.cpython-38-x86_64-linux-gnu.so, I placed in the dtc.py directory, but it is not imported , it throws the error "ibdtcclient.so: undefined symbol: _ZN6google21kLogSiteUninitializedE". I think it is problem in linking glog library (in fact I had to modify the make file ). How can the make file be fixed tp avoid this error?

I copy below the make file which works under linux

cmake_minimum_required(VERSION 3.13)
project(dtcclient)
set(CMAKE_CXX_STANDARD 17)

find_package(PkgConfig REQUIRED)
pkg_check_modules(glog REQUIRED libglog)





option(WITH_GFLAGS "Use gflags" OFF)
#find_package (glog 0.6.0 REQUIRED)
find_package(Boost COMPONENTS system)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

set(srcs_link
${Boost_LIBRARIES}
Threads::Threads
#glog::glog
stdc++fs
)

include_directories(
src src/dtc
)

set(srcs src/dtc/DTCProtocol.cpp src/dtc_session.cc
src/dtc_message_logging.cc src/symbol_data.cc src/dtc_trading.cc src/dtc_historical_data.cc src/dtc_market_data.cc src/util.cc)

add_library(dtcclient SHARED ${srcs}
#glog::glog ${glog_INCLUDE_DIRS}
${glog_INCLUDE_DIRS}
)
target_link_libraries(dtcclient ${srcs_link}
${glog_INCLUDE_DIRS})
target_include_directories(dtcclient PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/dtc
${glog_INCLUDE_DIRS}
)


target_compile_definitions(dtcclient PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})
add_library(dtcclient::dtcclient ALIAS dtcclient)

add_subdirectory(pybind11)
pybind11_add_module(dtcpy src/dtcpy.cpp)
#PYBIND11_MODULE(dtcpy src/dtcpy.cpp)
target_compile_definitions(dtcpy PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})
target_link_libraries(dtcpy PRIVATE dtcclient)