国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

clang: error: linker command failed with exit code 1 (use -v to see invocation)

這篇具有很好參考價(jià)值的文章主要介紹了clang: error: linker command failed with exit code 1 (use -v to see invocation)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

在OCR項(xiàng)目調(diào)研過(guò)程發(fā)現(xiàn)一個(gè)開(kāi)源工具gosseract,識(shí)別效果不錯(cuò);

按部就班準(zhǔn)備環(huán)境,先mac環(huán)境安裝tesseract(gosseract依賴):

brew install tesseract
$ tesseract -v
tesseract 4.1.3
 leptonica-1.82.0
  libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.1 : libopenjp2 2.4.0
 Found AVX2
 Found AVX
 Found FMA
 Found SSE

第一次安裝很順利,成功。

隨著業(yè)務(wù)需求增加,需要進(jìn)行語(yǔ)言訓(xùn)練,因此需要安裝訓(xùn)練工具, 選擇卸載重裝:

$ brew install --with-training-tools tesseract
Usage: brew install [options] formula|cask [...]

Install a formula or cask. Additional options specific to a formula may be
appended to the command.
...

Error: invalid option: --with-training-tools

提示此安裝方式已廢棄。所以選擇編譯安裝方式:

安裝依賴

# Packages which are always needed.
brew install automake autoconf libtool
brew install pkgconfig
brew install icu4c
brew install leptonica

# Packages required for training tools.
brew install pango

# Optional packages for extra features.
brew install libarchive

# Optional package for builds using g++.
brew install gcc

下載解壓

https://github.com/tesseract-ocr/tesseract/releases

安裝

cd tesseract-5.1.0
./autogen.sh
mkdir build
cd build

# Optionally add CXX=g++-8 to the configure command if you really want to use a different compiler.
../configure PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig
make -j

# Optionally install Tesseract.
sudo make install

# Optionally build and install training tools.
make training
sudo make training-install

問(wèn)題:

安裝好之后,編譯項(xiàng)目報(bào)錯(cuò):

2022/03/31 15:32:10 ERROR    ? 0004 Failed to build the application: # ocr
/usr/local/go/pkg/tool/darwin_amd64/link: running clang++ failed: exit status 1
Undefined symbols for architecture x86_64:
  "tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool)", referenced from:
      Init(void*, char*, char*) in 000023.o
      _Init in 000023.o
      _GetDataPath in 000023.o
  "tesseract::TessBaseAPI::Recognize(ETEXT_DESC*)", referenced from:
      _GetBoundingBoxesVerbose in 000023.o
      _GetBoundingBoxes in 000023.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

僅觀察報(bào)錯(cuò)內(nèi)容,沒(méi)發(fā)現(xiàn)是版本問(wèn)題,經(jīng)過(guò)多次卸載重裝后發(fā)現(xiàn)是版本太高導(dǎo)致的,于是重新安裝了4.1.3版本后服務(wù)正常編譯。

卸載方式可以手動(dòng)刪除安裝文件,或者通過(guò)命令:

brew uninstall tesseract

但是在后續(xù)安裝tesseract是會(huì)出現(xiàn)各種問(wèn)題,如下:

$ brew install tesseract==4.1.3
Warning: No available formula with the name "tesseract==4.1.3". Did you mean tesseract?
==> Searching for similarly named formulae...
This similarly named formula was found:
tesseract
To install it, run:
  brew install tesseract
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
liumeng@liumengdeMacBook-Pro Pictures % brew install tesseract
==> Downloading https://ghcr.io/v2/homebrew/core/tesseract/manifests/4.1.3
Already downloaded: /Users/liumeng/Library/Caches/Homebrew/downloads/9597a8ae2cb676cd25c79cf252f4eb8759b9cf3d472c57f7c764e086c5f8f6e2--tesseract-4.1.3.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/tesseract/blobs/sha256:1b67091dce98b42c6c561981a01738fe01c19ac69a1dc4de6d8e43fe885177f0
Already downloaded: /Users/liumeng/Library/Caches/Homebrew/downloads/cf8d3fbb1aea1cc629c6873a25b11d732c90ff23bfa4c44ba23d0ce5c24e907a--tesseract--4.1.3.big_sur.bottle.tar.gz
==> Pouring tesseract--4.1.3.big_sur.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/tesseract/apitypes.h
/usr/local/include/tesseract is not writable.

You can try again using:
  brew link tesseract
==> Caveats
This formula contains only the "eng", "osd", and "snum" language data files.
If you need any other supported languages, run `brew install tesseract-lang`.
==> Summary
??  /usr/local/Cellar/tesseract/4.1.3: 65 files, 29.7MB

查看報(bào)錯(cuò)信息,需要如下操作:

$ brew link tesseract
Linking /usr/local/Cellar/tesseract/4.1.3...
Error: Could not symlink include/tesseract/apitypes.h
/usr/local/include/tesseract is not writable.

此時(shí)需要先刪除一些文件:

$ sudo rm -rf  /usr/local/include/tesseract

繼續(xù)如下操作:

$ brew link tesseract
Linking /usr/local/Cellar/tesseract/4.1.3...
Error: Could not symlink share/tessdata/configs/alto
Target /usr/local/share/tessdata/configs/alto
already exists. You may want to remove it:
  rm '/usr/local/share/tessdata/configs/alto'

To force the link and overwrite all conflicting files:
  brew link --overwrite tesseract

To list all files that would be deleted:
  brew link --overwrite --dry-run tesseract

給了三種操作方法。

如下操作:

$ sudo rm -rf /usr/local/share/tessdata/configs/alto
$ brew link --overwrite --dry-run tesseract
Would remove:
/usr/local/share/tessdata/configs/ambigs.train
...
/usr/local/lib/libtesseract.dylib -> /usr/local/lib/libtesseract.5.dylib
/usr/local/lib/pkgconfig/tesseract.pc
liumeng@liumengdeMacBook-Pro Pictures % tesseract -v
zsh: command not found: tesseract
liumeng@liumengdeMacBook-Pro Pictures % brew install tesseract
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 7 casks.

Warning: tesseract 4.1.3 is already installed, it's just not linked.
To link this version, run:
  brew link tesseract
$ brew link --overwrite tesseract
Linking /usr/local/Cellar/tesseract/4.1.3...
Error: Could not symlink share/tessdata/configs/alto
/usr/local/share/tessdata/configs is not writable.

繼續(xù)刪除:

$ sudo rm -rf /usr/local/share/tessdata/configs
$ brew link --overwrite tesseract
Linking /usr/local/Cellar/tesseract/4.1.3...
Error: Could not symlink share/tessdata/tessconfigs/batch
/usr/local/share/tessdata/tessconfigs is not writable.
$ sudo rm -rf /usr/local/share/tessdata/tessconfigs
$ brew link --overwrite tesseract
Linking /usr/local/Cellar/tesseract/4.1.3... 12 symlinks created.

驗(yàn)證:

$ tesseract -v
tesseract 4.1.3
 leptonica-1.82.0
  libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.1 : libopenjp2 2.4.0
 Found AVX2
 Found AVX
 Found FMA
 Found SSE

項(xiàng)目編譯正常,結(jié)束!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-490942.html

到了這里,關(guān)于clang: error: linker command failed with exit code 1 (use -v to see invocation)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • XCode提示“Command PhaseScriptExecution failed with a nonzero exit code”

    許久沒(méi)有遇到XCode提示錯(cuò)誤信息了。針對(duì)這個(gè)問(wèn)題,網(wǎng)上也有教程。我的解決辦法是:查看Mac的【鑰匙串】,證書(shū)列表里存在多個(gè)證書(shū),有一對(duì)證書(shū)是相同的,并且一個(gè)是過(guò)期證書(shū),一個(gè)是有效證書(shū)。把過(guò)期證書(shū)刪除掉即可。 當(dāng)然也有其他博主給的信息。附上鏈接,方便大家

    2024年02月12日
    瀏覽(18)
  • IOS編譯出現(xiàn)Command PhaseScriptExecution failed with a nonzero exit code

    IOS編譯出現(xiàn)Command PhaseScriptExecution failed with a nonzero exit code

    在 Github 上下載了一個(gè)用 SwiftUI 開(kāi)發(fā)的仿微信Demo.用Xcode15運(yùn)行報(bào)以下錯(cuò)誤. 首先我們得找到具體的錯(cuò)誤,這報(bào)錯(cuò)太抽象啦. 那我們要在哪里看到具體的報(bào)錯(cuò)信息呢? 通過(guò)在 Stackoverflow 上搜索發(fā)現(xiàn),點(diǎn)擊導(dǎo)航欄最右邊的圖標(biāo) 選中最近的build,在右邊就能看到具體詳細(xì)的編譯錯(cuò)誤信

    2024年01月24日
    瀏覽(24)
  • 解決XCode錯(cuò)誤:Command PhaseScriptExecution failed with a nonzero exit code

    解決XCode錯(cuò)誤:Command PhaseScriptExecution failed with a nonzero exit code

    XCode版本:14.3 使用模擬器或真機(jī)調(diào)試、編譯等都不出錯(cuò),唯獨(dú)在進(jìn)行Archive時(shí),會(huì)出現(xiàn)以下錯(cuò)誤: 出錯(cuò)時(shí)的XCode截圖如下: 展開(kāi)XCode左側(cè)的項(xiàng)目結(jié)構(gòu)目錄,逐級(jí)展開(kāi)“Pods” - “Target Support Files” - \\\"Pods-項(xiàng)目名稱\\\",打開(kāi)其中的“Pods-項(xiàng)目名稱-frameworks.sh”文件: 在該文件中,找

    2024年02月11日
    瀏覽(20)
  • Xcode打包報(bào)錯(cuò) Command PhaseScriptExecution failed with a nonzero exit code

    iOS發(fā)布,xcode13不能用了需要升級(jí),不得已換了新電腦,安裝最新Xcode打包發(fā)布,版本15.0.1。 遇到的問(wèn)題,一打包就報(bào)錯(cuò): Command PhaseScriptExecution failed with a nonzero exit code,網(wǎng)上有兩種解決方法。 1:菜單欄選擇File - Workspace Setting - Build System 選擇Legacy Build System 重新運(yùn)行即可。

    2024年02月02日
    瀏覽(32)
  • Xcode打包遇到的坑 Command PhaseScriptExecution failed with a nonzero exit code

    Xcode打包遇到的坑 Command PhaseScriptExecution failed with a nonzero exit code

    這個(gè)問(wèn)題看網(wǎng)上的解決方法多為更改構(gòu)建方式。 這其實(shí)是一個(gè)Xcode10引起的bug。 解決方案: 在Xcode菜單欄選擇File - Workspace Setting - Build System 選擇Legacy Build System 重新運(yùn)行即可。 但是這里注意一下,我用最新的Xcode 14.2的版本并沒(méi)有換構(gòu)建方式的選項(xiàng)了,我改為13.4.1的版本后就

    2024年02月11日
    瀏覽(34)
  • Xcode14.3 升級(jí)后報(bào)錯(cuò) Command PhaseScriptExecution failed with a nonzero exit code

    Xcode14.3 升級(jí)后報(bào)錯(cuò) Command PhaseScriptExecution failed with a nonzero exit code

    xcode升級(jí)到14.3運(yùn)行和打包都報(bào)錯(cuò):Command PhaseScriptExecution failed with a nonzero exit code 注意: 1.不要嘗試去刪除 DerivedData 下的文件解決問(wèn)題,這只能是自己挖新坑 2.xcode14.3無(wú)論是swift項(xiàng)目還是oc項(xiàng)目,pod都有問(wèn)題,修復(fù)方法見(jiàn)文末 3.報(bào)錯(cuò)如下: 2.1 pod問(wèn)題 不要嘗試去重新安裝cocoap

    2023年04月26日
    瀏覽(28)
  • iOS 編譯報(bào)錯(cuò):Xcode Command PhaseScriptExecution failed with a nonzero exit code 解決方案

    iOS 編譯報(bào)錯(cuò):Xcode Command PhaseScriptExecution failed with a nonzero exit code 解決方案

    iOS 報(bào)錯(cuò)“ Xcode Command PhaseScriptExecution failed with a nonzero exit code ” 解決方案 問(wèn)題:xcode版本差異造成的不兼容。低版本xcode不兼容高版本xcode。 解決方案1: 在Xcode菜單欄選擇File - Workspace Setting - Build System 選擇Legacy Build System 重新運(yùn)行 解決方案2: 將低版本xcode升級(jí)為最新版本,

    2024年02月13日
    瀏覽(31)
  • brew?install報(bào)錯(cuò)Error: No developer tools installed.?Error: Command failed with exit 128: git

    brew?install報(bào)錯(cuò)Error: No developer tools installed.?Error: Command failed with exit 128: git

    先來(lái)解決第一個(gè)問(wèn)題 Error: No developer tools installed. Install the Command Line Tools: xcode-select --install 然后升級(jí)一下brew,出現(xiàn)警告。然后再次嘗試安裝tree 出現(xiàn)如下錯(cuò)誤: fatal: not in a git directory Error: Command failed with exit 128: git 在終端輸入 Homebrew 3.6.20 fatal: detected dubious ownership in repositor

    2024年02月05日
    瀏覽(31)
  • iOS-bug Xcode 14.3 archive打包失敗,command PhasescriptExecution failed with a nonzero exit code

    iOS-bug Xcode 14.3 archive打包失敗,command PhasescriptExecution failed with a nonzero exit code

    升級(jí)到Xcode14.3后,打包出現(xiàn)如下問(wèn)題 command PhasescriptExecution failed with a nonzero exit code 1、在Xcode中找到該路徑文件,Pods/Targets Support Files/Pods-xxxxx/Pods-xxxx-frameworks.sh 2、找到 source =\\\"$(readlink?\\\"${source}\\\")\\\"? 更改為 source =\\\"$(readlink -f \\\"${source}\\\")\\\" 3、修改完成后,重新archive即可成功,親測(cè)

    2024年02月14日
    瀏覽(25)
  • Job for network.service failed because the control process exited with error code.

    Linux Centos7 修改為靜態(tài)iP后重啟網(wǎng)絡(luò)服務(wù)遇到的問(wèn)題 重啟網(wǎng)絡(luò):service network restart ? ? ? ? ? ? ? ? ? /etc/init.d/network restart 報(bào)錯(cuò)問(wèn)題描述:Job for network.service failed because the control process exited with error code. See \\\"systemctl status network.service\\\" and \\\"journalctl -xe\\\" for details. ? 查看 cat /etc/sy

    2024年02月08日
    瀏覽(89)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包