I am trying to compile Cling on Visual Studio 2013.
There are a few compile errors here and there namely:
Use of inline namespaces
a few constexpr
cling::utils::platform::windows namespaces that needs to be fully specified when calling some functions
RegisterEHFrames and DeRegisterEHFrames use exception handling stuff not available in VS2013 on 32 bit build (looks like it’s 64 bit only stuff from MSDN).
Some of the /EXPORT: are leading to linking errors.
I have managed to compile somehow fixing these things and commenting the content of RegisterEHFrames and DeRegisterEHFrames but cling panics on a simple:
****************** CLING ******************
* Type C++ code and press enter to run it *
* Type .q to exit *
*******************************************
[cling]$ int i = 0; i
Assertion failed: !DD && Handlers.empty() && "Debug/EH info didn't get finalized
", file Z:\Desktop\cling\cling-build-windows\cling-src\lib\CodeGen\AsmPrinter\As
mPrinter.cpp, line 117
Wrote crash dump file "C:\Users\Stefano\AppData\Local\Temp\cling.exe-98abc4.dmp"
0x00D9C7F9 (0x00000016 0xD68F0FA8 0x0724CF00 0x0724CE14), HandleAbort() + 0x9 by
tes(s), z:\desktop\cling\cling-build-windows\cling-src\lib\support\windows\signa
ls.inc, line 404
0x5937F7F9 (0x00000016 0x00D9C7F0 0x0724CE00 0x59379AC4), raise() + 0x2B9 bytes(
s)
0x5938B284 (0x0724CF00 0x0724CE14 0x000000B7 0x088587F0), abort() + 0x34 bytes(s
)
0x59379AC4 (0x0563B168 0x0563B0A8 0x00000075 0x0724CE50), _wassert() + 0xD4 byte
s(s)
So my questions are:
Does Cling compile with Visual Studio ?
If yes, does Cling work with VS 2013 or does it need VS2015+ ?
The language / compiler issues look trivial to fix between VS2013 and VS2015 (few constexpr and inline namespace).
I assume that the main differences are in the injected exception handling code and symbol exports (/EXPORT: mangled names in the linker command line).
Where should I look then if for some reasons I would need to get this to compile under VS2013?
I remember there were more issues than that. For example, VS 2013 doesn’t fully support the C++11/14(/17) standard. And sorry, I don’t remember all the other issues I had… (since the master compiles just fine with VS 2015 anyway)
And nope, it has not been tested with VS 2017 (not yet)
Ok, I will give VS2015 and VS2017 a shot and investigate the differences in the case I will not be able to update our compilers from VS2013 to more recent.
I’ve used cmake -G “Visual Studio 14” and “Visual Studio 15” in an attempt to get cling to compile using visual studio 2015 with update 3, and also with visual studio 2017, and am having no luck.
Is there a specific branch i should be using to get it to compile on windows10 with vs2015/17?
Ahh yess. They are definitely easy instructions. It’s just that they don’t work
Which is why i tried to modify the cmake command by explicitly stating which version of visual studio to use…
In all attempts (including following the directions explicitly, or using the cpt.py file from https://github.com/vgvassilev/cling) I get a 'identifier “PRUNTIME_FUNCTION” is undefined" from obj.clingUtils project in file PlatformWin.cpp line 752. my winnt.h should have PRUNTIME_FUNCTION defined, along with RUNTIME_FUNCTION, but the error persists. Is there a particular update of VS2015 I should be using instead of Update 3? The same error exists using vs2017 as well.
cling-src\tools\cling\lib\Interpreter\DeclUnloader.cpp(876): error C2660: ‘clang::CodeGenerator::forgetDecl’ : function does not take 2 arguments
Thanks
Edit: The windows directions should be updated to include the -G “Visual Studio 14 2015 Win64” argument to cmake. Doing so I was able to complete the cmake --build . step.
But, my dependent DLLs(on which I need to work) are of 32 bit and hence am not able to load those DLLs in my cling interpreter. It throws error “cling::DynamicLibraryManager::loadLibrary(): LoadLibrary: returned 193: %1 is not a valid Win32 application”
So, is there a way to build 32 bit windows CLING or any build instructions link for the same?
I was able to build 32 bit CLING exe with -A win32 changes.
But when i try to load my .dll(32 bit dll) file, now I get the error “cling::DynamicLibraryManager::loadLibrary(): LoadLibrary: returned 126: The specified module could not be found.”
The steps I have followed are as below:
Launched cling.exe from cmd prompt
included all the header file paths needed for my DLL using .I option
.I C:\Users\test\Documents\Prabhuraj\TSRF\mst_msvp\Code\MSVP\Base_Lib\CommonAPI
.I C:\Users\test\Documents\Prabhuraj\TSRF\mst_msvp\Code\MSVP\Base_Lib\CoreLogger
.I C:\Users\test\Documents\Prabhuraj\TSRF\mst_msvp\Code\MSVP\SAS_Lib\scwl