AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / user-14175733

Raphael10's questions

Martin Hope
Raphael10
Asked: 2025-04-17 02:54:34 +0800 CST

Enviando para o repositório docker: o acesso solicitado ao recurso foi negado

  • 6

Imagem do docker criada:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ export MYREPO=raphaelcollab/stunner
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ sudo docker build -t $MYREPO/nexus .
[+] Building 71.6s (29/29) FINISHED                                                                                                                                                          docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                   0.0s
 => => transferring dockerfile: 2.79kB                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm-20240701-slim                                                                                                                       0.0s
 => [internal] load metadata for docker.io/hexpm/elixir:1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                                                                      0.0s
 => => transferring context: 1.31kB                                                                                                                                                                    0.0s
 => [internal] load build context                                                                                                                                                                      0.1s
 => => transferring context: 158.99kB                                                                                                                                                                  0.0s
 => [stage-1 1/6] FROM docker.io/library/debian:bookworm-20240701-slim                                                                                                                                 0.0s
 => [builder  1/17] FROM docker.io/hexpm/elixir:1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim                                                                                                     0.1s
 => [stage-1 2/6] RUN apt-get update -y &&   apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates   && apt-get clean && rm -f /var/lib/apt/lists/*_*                              9.4s
 => [builder  2/17] RUN apt-get update -y && apt-get install -y build-essential git pkg-config libssl-dev     && apt-get clean && rm -f /var/lib/apt/lists/*_*                                        28.4s
 => [stage-1 3/6] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen                                                                                                                     1.5s
 => [stage-1 4/6] WORKDIR /app                                                                                                                                                                         0.1s
 => [stage-1 5/6] RUN chown nobody /app                                                                                                                                                                0.2s
 => [builder  3/17] WORKDIR /app                                                                                                                                                                       0.0s
 => [builder  4/17] RUN mix local.hex --force &&     mix local.rebar --force                                                                                                                           2.1s
 => [builder  5/17] COPY mix.exs mix.lock ./                                                                                                                                                           0.1s
 => [builder  6/17] RUN mix deps.get --only prod                                                                                                                                                       2.9s
 => [builder  7/17] RUN mkdir config                                                                                                                                                                   0.2s
 => [builder  8/17] COPY config/config.exs config/prod.exs config/                                                                                                                                     0.1s
 => [builder  9/17] RUN mix deps.compile                                                                                                                                                              27.5s
 => [builder 10/17] COPY priv priv                                                                                                                                                                     0.0s
 => [builder 11/17] COPY lib lib                                                                                                                                                                       0.1s
 => [builder 12/17] COPY assets assets                                                                                                                                                                 0.1s
 => [builder 13/17] RUN mix assets.deploy                                                                                                                                                              6.6s
 => [builder 14/17] RUN mix compile                                                                                                                                                                    0.7s
 => [builder 15/17] COPY config/runtime.exs config/                                                                                                                                                    0.1s
 => [builder 16/17] COPY rel rel                                                                                                                                                                       0.0s
 => [builder 17/17] RUN mix release                                                                                                                                                                    1.4s
 => [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/prod/rel/nexus ./                                                                                                                0.4s
 => exporting to image                                                                                                                                                                                 0.6s
 => => exporting layers                                                                                                                                                                                0.5s
 => => writing image sha256:a0e0d292a593181591b1e354c7c5364717e1043cd2fd21acb8f7d3673ed8372d                                                                                                           0.0s
 => => naming to docker.io/raphaelcollab/stunner/nexus

Desconectado e conectado:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker logout
Removing login credentials for https://index.docker.io/v1/

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker login -u raphaelcollab

Tag docker criada: ( erro docker push "negado: acesso solicitado ao recurso foi negado" )

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker tag docker.io/raphaelcollab/stunner/nexus:latest docker.io/raphaelcollab/stunner/nexus

Tentou enviar para o repositório do docker:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker push docker.io/raphaelcollab/stunner/nexus
Using default tag: latest
The push refers to repository [docker.io/raphaelcollab/stunner/nexus]
0603097560bf: Preparing 
b5a39b1ed0d7: Preparing 
6ecbac9c9860: Preparing 
49d482126ff0: Preparing 
c5a36b2dc9a4: Preparing 
32148f9f6c5a: Waiting 
denied: requested access to the resource is denied

SO: Ubuntu 24.04

Adendo 1: Saída de docker login -u:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker login -u     
raphaelcollab

i Info → A Personal Access Token (PAT) can be used instead.
         To create a PAT, visit https://app.docker.com/settings
     
     
Password: 
Login Succeeded
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ 

Adendo 2:

Este é o repositório que criei no docker:

insira a descrição da imagem aqui

insira a descrição da imagem aqui

Adendo 3:

Só posso criar um repositório chamado stunner e não stunner/nexus

insira a descrição da imagem aqui

insira a descrição da imagem aqui

E quando eu envio para docker.io/raphaelcollab/stunner/nexus:latest meu acesso é negado:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker tag 
raphaelcollab/stunner/nexus:latest raphaelcollab/stunner/ 
nexus:latest

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker push docker.io/raphaelcollab/stunner/nexus:latest
The push refers to repository [docker.io/raphaelcollab/stunner/nexus]
0603097560bf: Preparing 
b5a39b1ed0d7: Preparing 
6ecbac9c9860: Preparing 
49d482126ff0: Preparing 
c5a36b2dc9a4: Preparing 
32148f9f6c5a: Waiting 
denied: requested access to the resource is denied

Como fazer isso funcionar?

docker
  • 1 respostas
  • 34 Views
Martin Hope
Raphael10
Asked: 2024-11-06 17:03:51 +0800 CST

/usr/local/bin/xmllint: símbolo indefinido: xmlMemSize ao compilar webkitgtk-2.46.3

  • 5

Durante a compilação da última versão estável webkitgtk-2.46.3, estou recebendo este erro:

raphy@raohy:~/Downloads/webkitgtk-2.46.3$ cmake --build builddir/

[ 92%] Built target WebCore_CopyPrivateHeaders
[ 92%] Built target WebKit-forwarding-headers
[ 92%] Generating ../../WebKitGTK/DerivedSources   
/ModernMediaControlsGResourceBundle.c,     ../../WebKitGTK/DerivedSources 
/ModernMediaControlsGResourceBundle.c.deps
 /usr/local/bin/xmllint: symbol lookup error: /usr/local/bin/xmllint: undefined symbol: xmlMemSize
/home/raphy/Downloads/webkitgtk-2.46.3/builddir/WebKitGTK/DerivedSources    /ModernMediaControlsGResourceBundle.xml: Child process exited with code 127.

Mas uma biblioteca xml2 adequada foi detectada:

raphy@raohy:~/Downloads$ tar -xf webkitgtk-2.46.3.tar.xz
raphy@raohy:~/Downloads$ cd webkitgtk-2.46.3/
raphy@raohy:~/Downloads/webkitgtk-2.46.3$

raphy@raohy:~/Downloads/webkitgtk-2.46.3$ cmake -B builddir -DPORT=GTK    
-DUSE_GSTREAMER_WEBRTC=TRUE -DENABLE_WEB_RTC=ON -DUSE_GTK4=OFF
-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
 CMake Warning at Source/cmake/WebKitCommon.cmake:10 (message):
  No CMAKE_BUILD_TYPE value specified, defaulting to RelWithDebInfo.
Call Stack (most recent call first):
  CMakeLists.txt:16 (include)

-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found suitable version "2.9.14", minimum  required is "2.8.0")   // <---------------------------------------------------------

libxml2 libxml2-dev libxml2-utilsjá estão instaladas as versões mais recentes:

raphy@raohy:~$ sudo apt-get install libxml2 libxml2-dev libxml2-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libxml2 is already the newest version (2.9.14+dfsg-1.3ubuntu3).
libxml2-dev is already the newest version (2.9.14+dfsg-1.3ubuntu3).
libxml2-utils is already the newest version (2.9.14+dfsg-1.3ubuntu3).

SO: Ubuntu 24.04

O que estou perdendo? Como fazer funcionar?

xml
  • 1 respostas
  • 19 Views
Martin Hope
Raphael10
Asked: 2024-02-17 18:35:29 +0800 CST

Como definir corretamente CMakeLists.txt para Tesseract?

  • 6

Quero compilar e construir com este código C++ tesseractCMake simples :

// https://tesseract-ocr.github.io/tessdoc/Examples_C++.html
#include <tesseract/baseapi.h>
#include <leptonica/allheaders.h>

int main()
{
    char *outText;

    tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
    // Initialize tesseract-ocr with English, without specifying tessdata path
    if (api->Init(NULL, "eng")) {
        fprintf(stderr, "Could not initialize tesseract.\n");
        exit(1);
    }

    // Open input image with leptonica library
    Pix *image = pixRead("phototest.tif");
    api->SetImage(image);
    // Get OCR result
    outText = api->GetUTF8Text();
    printf("OCR output:\n%s", outText);

    // Destroy used object and release memory
    api->End();
    delete api;
    delete [] outText;
    pixDestroy(&image);

    return 0;
}

Com este CMakeLists.txtarquivo:

cmake_minimum_required(VERSION 3.5)
project(BasicExample)

set(CMAKE_CXX_STANDARD 17)

find_package(PkgConfig REQUIRED)

pkg_check_modules(tesseract REQUIRED IMPORTED_TARGET tesseract)
pkg_check_modules(leptonica REQUIRED IMPORTED_TARGET lept)
pkg_check_moduleS(libcurl REQUIRED IMPORTED_TARGET libcurl)

add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE BasicExample.cpp)


target_link_libraries(BasicExample PUBLIC
    PkgConfig::leptonica
    PkgConfig::tesseract
    -lcurl
)

Estou recebendo estes erros:

raphy@raohy:~/tesseract/Examples$ cmake -B builddir
-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for module 'tesseract'
--   Found tesseract, version 5.3.4
-- Checking for module 'lept'
--   Found lept, version 1.82.0
-- Checking for module 'libcurl'
--   Found libcurl, version 8.2.1
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/tesseract/Examples/builddir
raphy@raohy:~/tesseract/Examples$ 
raphy@raohy:~/tesseract/Examples$ cmake --build builddir/
[ 50%] Building CXX object CMakeFiles/BasicExample.dir/BasicExample.cpp.o
[100%] Linking CXX executable BasicExample
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o): in function `tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*)::{lambda(char const*)#1}::operator()(char const*) const':
baseapi.cpp:(.text+0x13): undefined reference to `curl_easy_strerror'
/usr/bin/ld: baseapi.cpp:(.text+0x3b): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o): in function `tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*)':
baseapi.cpp:(.text+0xad07): undefined reference to `curl_easy_init'
/usr/bin/ld: baseapi.cpp:(.text+0xad48): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xad5d): undefined reference to `curl_easy_strerror'
/usr/bin/ld: baseapi.cpp:(.text+0xad89): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: baseapi.cpp:(.text+0xb26f): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb298): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb2c1): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb2fa): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb324): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o):baseapi.cpp:(.text+0xb3c9): more undefined references to `curl_easy_setopt' follow
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o): in function `tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*)':
baseapi.cpp:(.text+0xb455): undefined reference to `curl_easy_perform'
/usr/bin/ld: baseapi.cpp:(.text+0xb6b0): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: /usr/local/lib/libtesseract.a(tessdatamanager.cpp.o): in function `tesseract::TessdataManager::LoadArchiveFile(char const*)':
tessdatamanager.cpp:(.text+0x199): undefined reference to `archive_read_new'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1ad): undefined reference to `archive_read_support_filter_all'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1b5): undefined reference to `archive_read_support_format_all'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1c5): undefined reference to `archive_read_open_filename'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1e6): undefined reference to `archive_entry_pathname'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1f6): undefined reference to `archive_read_next_header'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x208): undefined reference to `archive_read_free'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x294): undefined reference to `archive_entry_size'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x2e1): undefined reference to `archive_read_data'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/BasicExample.dir/build.make:99: BasicExample] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/BasicExample.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

Mas este CMakeLists.txt :

# https://stackoverflow.com/questions/28165518/use-libcurl-undefined-reference-to-curl-easy-init
cmake_minimum_required(VERSION 3.5)
project(Url2File)

set(CMAKE_CXX_STANDARD 17)

find_package(PkgConfig REQUIRED)

pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl)

add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE url2file.c)

target_link_libraries(${PROJECT_NAME} PUBLIC
    -lcurl
)

para este exemplo de uso de libcurl:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <curl/curl.h>

static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{
  size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
  return written;
}

int main(int argc, char *argv[])
{
  CURL *curl_handle;
  static const char *pagefilename = "page.out";
  FILE *pagefile;

  if(argc < 2) {
    printf("Usage: %s <URL>\n", argv[0]);
    return 1;
  }

  curl_global_init(CURL_GLOBAL_ALL);

  /* init the curl session */
  curl_handle = curl_easy_init();

  /* set URL to get here */
  curl_easy_setopt(curl_handle, CURLOPT_URL, argv[1]);

  /* Switch on full protocol/debug output while testing */
  curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L);

  /* disable progress meter, set to 0L to enable it */
  curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);

  /* send all data to this function  */
  curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);

  /* open the file */
  pagefile = fopen(pagefilename, "wb");
  if(pagefile) {

    /* write the page body to this file handle */
    curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile);

    /* get it! */
    curl_easy_perform(curl_handle);

    /* close the header file */
    fclose(pagefile);
  }

  /* cleanup curl stuff */
  curl_easy_cleanup(curl_handle);

  curl_global_cleanup();

  return 0;
}

funciona bem :

raphy@raohy:~/curlExample$ cmake --build builddir/
[ 50%] Building C object CMakeFiles/Url2File.dir/url2file.c.o
[100%] Linking C executable Url2File
[100%] Built target Url2File

Atualização 1)

Tentei deixar apenas lcurl como target_link_libraries:

target_link_libraries(BasicExample PUBLIC
    #PkgConfig::leptonica
    #PkgConfig::tesseract
    -lcurl
)

e, na verdade, os erros sobre o libcurl desapareceram:

raphy@raohy:~/tesseract/Examples$ cmake --build builddir/
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/tesseract/Examples/builddir
[ 50%] Building CXX object CMakeFiles/BasicExample.dir/BasicExample.cpp.o
[100%] Linking CXX executable BasicExample
/usr/bin/ld: CMakeFiles/BasicExample.dir/BasicExample.cpp.o: in function `main':
BasicExample.cpp:(.text+0x37): undefined reference to `tesseract::TessBaseAPI::TessBaseAPI()'
/usr/bin/ld: BasicExample.cpp:(.text+0x98): undefined reference to `pixRead'
/usr/bin/ld: BasicExample.cpp:(.text+0xaf): undefined reference to `tesseract::TessBaseAPI::SetImage(Pix*)'
/usr/bin/ld: BasicExample.cpp:(.text+0xbb): undefined reference to `tesseract::TessBaseAPI::GetUTF8Text()'
/usr/bin/ld: BasicExample.cpp:(.text+0xe6): undefined reference to `tesseract::TessBaseAPI::End()'
/usr/bin/ld: BasicExample.cpp:(.text+0x11d): undefined reference to `pixDestroy'
/usr/bin/ld: CMakeFiles/BasicExample.dir/BasicExample.cpp.o: in function `tesseract::TessBaseAPI::Init(char const*, char const*)':
BasicExample.cpp:(.text._ZN9tesseract11TessBaseAPI4InitEPKcS2_[_ZN9tesseract11TessBaseAPI4InitEPKcS2_]+0x43): undefined reference to `tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, bool)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/BasicExample.dir/build.make:97: BasicExample] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/BasicExample.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

Mas peguei os erros de ligação do tesseract e leptonica

Com base nas respostas deste post: Use a referência indefinida de libcurl para 'curl_easy_init' , -lcurldeve ser colocada no final do comando gcc. Então... como vincular todos eles corretamente?

Com isso CmakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(BasicExample)

set(CMAKE_CXX_STANDARD 17)

find_package(PkgConfig REQUIRED)

pkg_check_modules(tesseract REQUIRED IMPORTED_TARGET tesseract)
pkg_check_modules(leptonica REQUIRED IMPORTED_TARGET lept)
pkg_check_moduleS(libcurl REQUIRED IMPORTED_TARGET libcurl)

add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE BasicExample.cpp)


target_link_libraries(BasicExample PUBLIC
    PkgConfig::leptonica
    PkgConfig::tesseract
    -lcurl
)

Esta é a saída de /builddir$ make VERBOSE=1:

raphy@raohy:~/tesseract/Examples/builddir$ make VERBOSE=1
/usr/local/bin/cmake -S/home/raphy/tesseract/Examples -B/home/raphy/tesseract/Examples/builddir --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/raphy/tesseract/Examples/builddir/CMakeFiles /home/raphy/tesseract/Examples/builddir//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/raphy/tesseract/Examples/builddir'
make  -f CMakeFiles/BasicExample.dir/build.make CMakeFiles/BasicExample.dir/depend
make[2]: Entering directory '/home/raphy/tesseract/Examples/builddir'
cd /home/raphy/tesseract/Examples/builddir && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/raphy/tesseract/Examples /home/raphy/tesseract/Examples /home/raphy/tesseract/Examples/builddir /home/raphy/tesseract/Examples/builddir /home/raphy/tesseract/Examples/builddir/CMakeFiles/BasicExample.dir/DependInfo.cmake "--color="
Dependencies file "CMakeFiles/BasicExample.dir/BasicExample.cpp.o.d" is newer than depends file "/home/raphy/tesseract/Examples/builddir/CMakeFiles/BasicExample.dir/compiler_depend.internal".
Consolidate compiler generated dependencies of target BasicExample
make[2]: Leaving directory '/home/raphy/tesseract/Examples/builddir'
make  -f CMakeFiles/BasicExample.dir/build.make CMakeFiles/BasicExample.dir/build
make[2]: Entering directory '/home/raphy/tesseract/Examples/builddir'
[ 50%] Linking CXX executable BasicExample
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/BasicExample.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/BasicExample.dir/BasicExample.cpp.o -o BasicExample  -lcurl /usr/lib/x86_64-linux-gnu/liblept.so /usr/local/lib/libtesseract.a
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o): in function `tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*)::{lambda(char const*)#1}::operator()(char const*) const':
baseapi.cpp:(.text+0x13): undefined reference to `curl_easy_strerror'
/usr/bin/ld: baseapi.cpp:(.text+0x3b): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o): in function `tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*)':
baseapi.cpp:(.text+0xad07): undefined reference to `curl_easy_init'
/usr/bin/ld: baseapi.cpp:(.text+0xad48): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xad5d): undefined reference to `curl_easy_strerror'
/usr/bin/ld: baseapi.cpp:(.text+0xad89): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: baseapi.cpp:(.text+0xb26f): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb298): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb2c1): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb2fa): undefined reference to `curl_easy_setopt'
/usr/bin/ld: baseapi.cpp:(.text+0xb324): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o):baseapi.cpp:(.text+0xb3c9): more undefined references to `curl_easy_setopt' follow
/usr/bin/ld: /usr/local/lib/libtesseract.a(baseapi.cpp.o): in function `tesseract::TessBaseAPI::ProcessPagesInternal(char const*, char const*, int, tesseract::TessResultRenderer*)':
baseapi.cpp:(.text+0xb455): undefined reference to `curl_easy_perform'
/usr/bin/ld: baseapi.cpp:(.text+0xb6b0): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: /usr/local/lib/libtesseract.a(tessdatamanager.cpp.o): in function `tesseract::TessdataManager::LoadArchiveFile(char const*)':
tessdatamanager.cpp:(.text+0x199): undefined reference to `archive_read_new'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1ad): undefined reference to `archive_read_support_filter_all'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1b5): undefined reference to `archive_read_support_format_all'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1c5): undefined reference to `archive_read_open_filename'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1e6): undefined reference to `archive_entry_pathname'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x1f6): undefined reference to `archive_read_next_header'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x208): undefined reference to `archive_read_free'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x294): undefined reference to `archive_entry_size'
/usr/bin/ld: tessdatamanager.cpp:(.text+0x2e1): undefined reference to `archive_read_data'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/BasicExample.dir/build.make:99: BasicExample] Error 1
make[2]: Leaving directory '/home/raphy/tesseract/Examples/builddir'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/BasicExample.dir/all] Error 2
make[1]: Leaving directory '/home/raphy/tesseract/Examples/builddir'
make: *** [Makefile:91: all] Error 2
raphy@raohy:~/tesseract/Examples/builddir$ 

O que estou perdendo ? Como fazer o CMakeLists.txt funcionar para o exemplo de código C++ do tesseract?

c++
  • 1 respostas
  • 49 Views
Martin Hope
Raphael10
Asked: 2024-02-05 20:36:52 +0800 CST

Como alterar programaticamente o estilo de uma única palavra de um parágrafo HTML?

  • 5

Gostaria de alterar programaticamente o estilo de uma única palavra de um parágrafo HTML

let textToSearch = "testing"

let beforeNode = document.createElement('p');
let afterNode = document.createElement('p');

let highlightedSpan = document.createElement('span')
highlightedSpan.innerHTML = textToSearch;
highlightedSpan.style.backgroundColor = "yellow"
let newPar = document.createElement('p');
newPar.appendChild(highlightedSpan);

document.querySelectorAll('p').forEach((par) => {
  let cont = par.textContent;
  let startingPos = cont.indexOf(textToSearch)
  console.log(startingPos)
  if (startingPos !== -1) {
    let firstPart = cont.slice(0, startingPos - 1)
    let thirdPart = cont.slice(startingPos + textToSearch.length, cont.length - 1)
    beforeNode.appendChild(document.createTextNode(firstPart))
    afterNode.appendChild(document.createTextNode(thirdPart))
    par.replaceWith(beforeNode, highlightedSpan, afterNode)
  }
})
<p> A complete text for testing purposes</p>

Eu recebo esta saída:

insira a descrição da imagem aqui

Mas gostaria de entender se existe uma maneira visualmente melhor (agora o conteúdo do texto está visualmente espalhado em três linhas) e mais limpa de alterar o estilo de uma única palavra de um parágrafo HTML

javascript
  • 1 respostas
  • 52 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Reformatar números, inserindo separadores em posições fixas

    • 6 respostas
  • Marko Smith

    Por que os conceitos do C++20 causam erros de restrição cíclica, enquanto o SFINAE antigo não?

    • 2 respostas
  • Marko Smith

    Problema com extensão desinstalada automaticamente do VScode (tema Material)

    • 2 respostas
  • Marko Smith

    Vue 3: Erro na criação "Identificador esperado, mas encontrado 'import'" [duplicado]

    • 1 respostas
  • Marko Smith

    Qual é o propósito de `enum class` com um tipo subjacente especificado, mas sem enumeradores?

    • 1 respostas
  • Marko Smith

    Como faço para corrigir um erro MODULE_NOT_FOUND para um módulo que não importei manualmente?

    • 6 respostas
  • Marko Smith

    `(expression, lvalue) = rvalue` é uma atribuição válida em C ou C++? Por que alguns compiladores aceitam/rejeitam isso?

    • 3 respostas
  • Marko Smith

    Um programa vazio que não faz nada em C++ precisa de um heap de 204 KB, mas não em C

    • 1 respostas
  • Marko Smith

    PowerBI atualmente quebrado com BigQuery: problema de driver Simba com atualização do Windows

    • 2 respostas
  • Marko Smith

    AdMob: MobileAds.initialize() - "java.lang.Integer não pode ser convertido em java.lang.String" para alguns dispositivos

    • 1 respostas
  • Martin Hope
    Fantastic Mr Fox Somente o tipo copiável não é aceito na implementação std::vector do MSVC 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant Encontre o próximo dia da semana usando o cronógrafo 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor O inicializador de membro do construtor pode incluir a inicialização de outro membro? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský Por que os conceitos do C++20 causam erros de restrição cíclica, enquanto o SFINAE antigo não? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul O C++20 mudou para permitir a conversão de `type(&)[N]` de matriz de limites conhecidos para `type(&)[]` de matriz de limites desconhecidos? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann Como/por que {2,3,10} e {x,3,10} com x=2 são ordenados de forma diferente? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller O ponto e vírgula agora é opcional em condicionais bash com [[ .. ]] na versão 5.2? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench Por que um traço duplo (--) faz com que esta cláusula MariaDB seja avaliada como verdadeira? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng Por que `dict(id=1, **{'id': 2})` às vezes gera `KeyError: 'id'` em vez de um TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob: MobileAds.initialize() - "java.lang.Integer não pode ser convertido em java.lang.String" para alguns dispositivos 2024-03-20 03:12:31 +0800 CST

Hot tag

python javascript c++ c# java typescript sql reactjs html

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve