Я получаю
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x54ab): undefined reference to `operator new(unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x54bf): undefined reference to `operator new[](unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5542): undefined reference to `operator new(unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5556): undefined reference to `operator new[](unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x55d9): undefined reference to `operator new(unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x566c): undefined reference to `operator new(unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x56ff): undefined reference to `operator new(unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5713): undefined reference to `operator new[](unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5a96): undefined reference to `operator new[](unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5c06): undefined reference to `operator new[](unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5ca9): undefined reference to `operator new(unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5cbd): undefined reference to `operator new[](unsigned long long)'
mingw-w64-x86_64-static-tesseract/lib/libtesseract.a(lstm.o):(.text+0x5d41): undefined reference to `operator new(unsigned long long)'
...
при компиляции моего проекта cmake с использованием оболочки MinGW на MSYS2 и связи с tesseract https://github.com/bradosia/mingw-w64-x86_64-static-tesseract (но я только ссылка на libtesseract.a
).
Эта ошибка выглядит, как из библиотеки libstdc ++. Вот мой CMakeLists.txt, вы можете видеть, что я пытался добавить его:
cmake_minimum_required(VERSION 3.5)
project(roosek2 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#find_package(Qt5 COMPONENTS Core Quick REQUIRED)
add_executable(roosek2
main.cpp
qml.qrc
ImageStream.cpp
YuvUtils.cpp
#CameraView.cpp
)
add_library(ctmedia_codec MODULE IMPORTED)
add_library(ctstream MODULE IMPORTED)
add_library(maincore MODULE IMPORTED)
add_library(tesseract STATIC IMPORTED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mingw-w64-x86_64-static-tesseract/include/tesseract)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mingw-w64-x86_64-static-tesseract/include/leptonica)
#link_directories(${CMAKE_CURRENT_SOURCE_DIR}/win_bin/lib/x64)
set_target_properties(ctmedia_codec PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/win_bin/lib/x64/CTMedia.lib)
set_target_properties(ctstream PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/win_bin/lib/x64/CTStream.lib)
set_target_properties(maincore PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/win_bin/lib/x64/WPMainCore.lib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mingw-w64-x86_64-static-tesseract/include/)
set_target_properties(tesseract PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/mingw-w64-x86_64-static-tesseract/lib/libtesseract.a)
include_directories("include")
target_link_libraries(roosek2 ctmedia_codec ctstream maincore tesseract stdc++)