Help. I can’t figure out what the reason is.When inserting a project in a class .H when building, I get these errors
In file included from /usr/local/include/wx-3.2/wx/intl.h:18,
from /usr/local/include/wx-3.2/wx/wx.h:22,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/setting/filesetting.h:6,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/setting/setting.h:5,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/dataglobal.h:4,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.h:3,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.cpp:1:
/usr/local/torch/libtorch/include/ATen/core/function_schema.h: In constructor ‘c10::Argument::Argument(std::string, c10::TypePtr, c10::TypePtr, std::optional, std::optionalc10::IValue, bool, std::optionalc10::AliasInfo)’:
/usr/local/torch/libtorch/include/ATen/core/function_schema.h:49:9: error: anachronistic old-style base class initializer [-fpermissive]
49 | N_(N),
| ^~
In file included from /usr/local/torch/libtorch/include/ATen/core/op_registration/infer_schema.h:8,
from /usr/local/torch/libtorch/include/torch/library.h:61,
from /usr/local/torch/libtorch/include/torch/csrc/autograd/autograd_not_implemented_fallback.h:3,
from /usr/local/torch/libtorch/include/torch/csrc/api/include/torch/autograd.h:4,
from /usr/local/torch/libtorch/include/torch/csrc/api/include/torch/all.h:7,
from /usr/local/torch/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
from /home/alex/devel/ScalpByBit/include/nn/nnlibtrade.h:3,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/nn/nntrade.h:4,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/dataglobal.h:13,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.h:3,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.cpp:1:
/usr/local/torch/libtorch/include/ATen/core/function_schema.h:48:61: error: unnamed initializer for ‘c10::Argument’, which has no base classes
48 | real_type_(real_type ? std::move(real_type) : type_),
| ^
In file included from /usr/local/include/wx-3.2/wx/intl.h:18,
from /usr/local/include/wx-3.2/wx/wx.h:22,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/setting/filesetting.h:6,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/setting/setting.h:5,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/dataglobal.h:4,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.h:3,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.cpp:1:
/usr/local/torch/libtorch/include/ATen/core/function_schema.h: In copy constructor ‘c10::Argument::Argument(const c10::Argument&)’:
/usr/local/torch/libtorch/include/ATen/core/function_schema.h:64:9: error: anachronistic old-style base class initializer [-fpermissive]
64 | N_(rhs.N_),
| ^~
In file included from /usr/local/torch/libtorch/include/ATen/core/op_registration/infer_schema.h:8,
from /usr/local/torch/libtorch/include/torch/library.h:61,
from /usr/local/torch/libtorch/include/torch/csrc/autograd/autograd_not_implemented_fallback.h:3,
from /usr/local/torch/libtorch/include/torch/csrc/api/include/torch/autograd.h:4,
from /usr/local/torch/libtorch/include/torch/csrc/api/include/torch/all.h:7,
from /usr/local/torch/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
from /home/alex/devel/ScalpByBit/include/nn/nnlibtrade.h:3,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/nn/nntrade.h:4,
from /home/alex/devel/ScalpByBit/src/cashbackbot/…/data/dataglobal.h:13,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.h:3,
from /home/alex/devel/ScalpByBit/src/cashbackbot/cashbackitems.cpp:1:
/usr/local/torch/libtorch/include/ATen/core/function_schema.h:63:35: error: unnamed initializer for ‘c10::Argument’, which has no base classes
63 | real_type_(rhs.real_type_),
Cmake
cmake_minimum_required(VERSION 3.20.0)
project(ScalpByBit VERSION 0.1.0)
set(FileNAME scalp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_PREFIX_PATH "/usr/local/torch/libtorch")
set(CMAKE_CUDA_COMPILER "/usr/local/cuda-12.4/bin/nvcc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
find_package(Torch REQUIRED)
find_package(wxWidgets REQUIRED COMPONENTS aui html net core base)
include(${wxWidgets_USE_FILE})
file(GLOB project
src/*
src/data/*
src/data/bybit/*
src/data/setting/*
src/data/nn/*
src/res/*
src/setting/*
src/kline/*
src/orderbook/*
src/cashbackbot/*
src/wsuser/*
src/wsuser/*
src/trade/*
)
add_executable(${FileNAME} ${project})
if(wxWidgets_FOUND)
target_link_libraries(${FileNAME} ${wxWidgets_LIBRARIES})
message(STATUS "Found wxWidgets ${wxWidgets_VERSION_STRING}")
else()
message(STATUS "wxWidgets Not Found")
endif()
target_link_libraries(${FileNAME} "${TORCH_LIBRARIES}")
set_property(TARGET ${FileNAME} PROPERTY CXX_STANDARD 17)