简体   繁体   中英

Run cling on Windows

Is it possible to run cling on Windows?

I successfully compiled cling from sources ( build instructions ) with Visual C++ 12.0, but when I try to run I have the following runtime error:

F:\Dev\open-source\Cling\src\build\Debug\bin>cling.exe
ERROR in cling::CIFactory::createCI():
  resource directory F:\Dev\open-source\Cling\src\build\Debug\lib\clang\3.6.0 not found!
Assertion failed: !CurTokenLexer && "Cannot #include a file inside a macro!", file ..\..\..\..\..\tools\clang\lib\Lex\PPLexerChange.cpp, line 73

I googled next link:

BTW, I have Clang (Clang version 3.6.0 (trunk)) and everything works fine.

When I run with cling -xc , I still have the same error, but without assertion ( -x means treat subsequent input files as having type <language>):

F:\Dev\open-source\Cling\src\build\Debug\bin>cling -x c
ERROR in cling::CIFactory::createCI():
  resource directory F:\Dev\open-source\Cling\src\build\Debug\lib\clang\3.6.0 not found!

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ #include <stdio.h>
[cling]$ printf("%s", "test");
test
[cling]$

From this link :

The limitation of cling on Windows comes from the fact that clang doesn't support fully windows mangling scheme, ie it is not binary compatible. For example, one cannot call a function compiled with other than clang/gcc compiler. - There is a lot of progress in that direction recently on the clang side. We should investigate why cling chalks up. Ie is everything set up correctly in the CIFactory in the case where the OS is windows. - Since C doesn't have mangling cling in C mode must be working on Windows (ie cling -xc)

... This is an issue which we intend to work on soon and patches are very welcome.

From this link :

The limitation of cling on Windows comes from the fact that clang doesn't support fully windows mangling scheme, ie it is not binary compatible. For example, one cannot call a function compiled with other than clang/gcc compiler.

  • There is a lot of progress in that direction recently on the clang side. We should investigate why cling chalks up. Ie is everything set up correctly in the CIFactory in the case where the OS is windows.

  • Since C doesn't have mangling cling in C mode must be working on Windows (ie cling -xc)

... This is an issue which we intend to work on soon and patches are very welcome.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM