0

Windows 7 で MinGw を使用して cling をコンパイルしようとしています。次のエラーで 90% で失敗します。

C:\cling\src\tools\cling\lib\Interpreter\Exception.cpp:44:62: error: exception handling disabled, use -fexceptions to enable
           cling::InvalidDerefException::DerefType::NULL_DEREF);
                                                              ^

これらのコマンドを使用してビルドしました:

cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="c:/cling" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="C:/Qt/Qt5.14.1/Tools/mingw730_32/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/Qt/Qt5.14.1/Tools/mingw730_32/bin/g++.exe" ..\src
cmake --build .

-fexceptions を this: -DCMAKE_CXXFLAGS="-fexceptions" および this: のような cmake タグに追加しようとしました-DCMAKE_CXX_FLAGS="-fexceptions" が、役に立ちません。同じエラーが発生します。

どんな助けでも大歓迎です。


編集:

これを回避しようとしましたが、ファイルを変更して\tools\cling\lib\Interpreter\CMakeLists.txtこの\tools\cling\lib\UserInterface\CMakeLists.txtエラーを取り除きました。に変更if (UNIX)しましたif (LLVM_COMPILER_IS_GCC_COMPATIBLE)

次にwchar_t、次のような変換エラーが発生 したため、cmake 呼び出しerror: cannot convert 'LPTSTR {aka char*}' to 'const wchar_t*'に追加しました。-DCMAKE_CXX_FLAGS="-DUNICODE -D_UNICODE"

cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="c:/cling" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="C:/Qt/Qt5.14.1/Tools/mingw730_32/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/Qt/Qt5.14.1/Tools/mingw730_32/bin/g++.exe" -DCMAKE_CXX_FLAGS="-DUNICODE -D_UNICODE" ..\src

次のエラーが表示されます。

C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp: In function 'int cling::utils::platform::windows::GetVisualStudioVersionCompiledWith()':
C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp:380:11: error: '_MSC_VER' was not declared in this scope
   return (_MSC_VER / 100) - 6;
           ^~~~~~~~
C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp:380:11: note: suggested alternative: '_TSCHAR'
   return (_MSC_VER / 100) - 6;
           ^~~~~~~~
           _TSCHAR
C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp: In function 'const void* cling::utils::platform::DLSym(const string&, std::__cxx11::string*)':
C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp:614:42: error: invalid conversion from 'FARPROC {aka int (__attribute__((__stdcall__)) *)()}' to 'v
oid*' [-fpermissive]
         if (void* Addr = ::GetProcAddress(*It, s.c_str())) {
                          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp:625:44: error: invalid conversion from 'FARPROC {aka int (__attribute__((__stdcall__)) *)()}' to 'v
oid*' [-fpermissive]
           if (void* Addr = ::GetProcAddress(Modules[i], s.c_str()))
                            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
C:\cling\src\tools\cling\lib\Utils\PlatformWin.cpp: In function 'bool cling::utils::platform::Popen(const string&, llvm::SmallVectorImpl<char>&, bool)
':

エラーは問題ではないと思い_MSC_VERます。ランダムなバージョンを偽造できますが、FARPROCtoのキャストはvoid*どうですか?

4

0 に答える 0