編集する:

編集する:

私は32ビットCentOS 7を実行しています。ソースからtesseractをインストールしようとしています。 g++バージョン4.8.5を使用していますが、コンパイル中にエラーが発生します(次のように)。これ)ソースからg ++を更新しようとしています。いくつかの問題が発生した後、正常にインストールされ、g++ -vバージョンが10.0.0というメッセージを受け取りました。

ただし、maketesseractフォルダ内で実行してもエラーは変わりません。

以前のバージョンが/usr/bin/にインストールされている間、新しいg ++が/usr/local/bin/にインストールされていることがわかりました。だから(これは本当に悪いかもしれませんが…)バックアップ/ usr / binを作成しました。代わりに /g++ を選択し、新しいバージョン (/usr/local/bin/ から) をコピーしてください。make新しいエラーが表示され始めます。

checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/home/lambda/Téléchargements/tesseract':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
make: *** [config.status] Erreur 77

config.logを確認したいのですが、長すぎます。ところで、この部分が面白そうだと思いました。

configure:2592: checking for g++
configure:2608: found /bin/g++
configure:2619: result: g++
configure:2646: checking for C++ compiler version
configure:2655: g++ --version >&5
g++ (GCC) 10.0.0 20191014 (experimental)

g++を使って単純なhello worldプログラムをコンパイルしようとしましたが、うまくいきます。

助けてくれてありがとう!私は初心者なので、簡単なことを忘れてしまったかもしれません。

編集する:

これは面白いかもしれないconfig.logのもう一つの部分です。

configure:2686: checking whether the C++ compiler works
configure:2708: g++    conftest.cpp  >&5
g++: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
configure:2712: $? = 1
configure:2750: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "tesseract"
| #define PACKAGE_TARNAME "tesseract"
| #define PACKAGE_VERSION "5.0.0-alpha"
| #define PACKAGE_STRING "tesseract 5.0.0-alpha"
| #define PACKAGE_BUGREPORT "https://github.com/tesseract-ocr/tesseract/issues"
| #define PACKAGE_URL "https://github.com/tesseract-ocr/tesseract/"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2755: error: in `/home/lambda/Téléchargements/tesseract':
configure:2757: error: C++ compiler cannot create executables

ベストアンサー1

まあ、私は方法を見つけました。

だけでなく:

make

私は以下を使用しようとしています:

make CXX=/usr/local/bin/g++

それは私の問題を解決しました...

おすすめ記事