Home | News | Documentation | Download

Includes error in VS2019 (RWrap_libcpp_string_view.h)

Hi there,

I am using Visual Studio 2019 and ROOT version 6.18/04. I recently installed Python development tools in VS which installed Python to my PC. However after doing this, my ROOT programs have stopped working and VS returns the errors:

1>C:\root\include\ROOT\RWrap_libcpp_string_view.h(429,34): error C2039: ‘__find_end’: is not a member of ‘std’
1>C:\root\include\ROOT\RWrap_libcpp_string_view.h(125): message : see declaration of ‘std’
1>C:\root\include\ROOT\libcpp_string_view.h(193,9): warning C4068: unknown pragma

I don’t know whether the cause of this has anything to do with my Python installation or a Windows Update but my ROOT programs are now not working on two computers that I installed Python on via the Python development tools in VS. The error occurs in simple ROOT programs compiled in VS aswell such as:

#include <TApplication.h>
#include <TF1.h>
#include <TRandom3.h>
int main(int argc, char** argv)
{
	TApplication theApp("App", &argc, argv);
	TF1* f1 = new TF1("f1", "sin(x)/x", 0, gRandom->Rndm() * 10);
	theApp.Run();
	return 0;
}

I have tried running the programs on my laptop which had no Python installation and it worked fine.
Also I have attempted to uninstall Python on one of the computers but the problem still remains.

Any advice would be appreciated.

_ROOT Version: 6.18/04
Platform: Windows 10
Compiler: Visual Studio


Our Windows expert, @bellenot, may have an idea.

Well, I have python installed on my computers and have no problem with ROOT… The only difference is that I installed Python stand-alone (i.e. not the Python development tools in VS)
I’ll try and let you know

Okay, thank you. I haven’t been able to fix the problem but this has happened on 2 computers that I had installed Python on via the development tools in VS. I have now uninstalled Python and removed as many traces of Python as I can find and even removed VS and reinstalled it a few times but nothing has worked for me.
I have a laptop that works fine however without the install on it. My guess is that something in VS is the problem.

The issue is that if this is caused by installing Python via the development tools in VS, I don’t see how we can fix this on the ROOT side

Yes I understand that. I just wanted to make the issue known. Do you think I should try to report this to VS support?

If you wish, but from my experience, it’s sometimes difficult to come with a very simple reproducer (e.g. don’t ask them to install ROOT :wink:)

I will try and report it then. I was wondering that since my VS is screwed up now whether you could recommend another IDE to use for ROOT in Windows.

I use the VS Code editor (which is free and cross-platform) for editing and the full Visual Studio IDE only for debugging

Thank you for your response. I will try and set up VS Code editor with ROOT. Do you have any tips on how to do this?

Simply install it, it is not connected to ROOT at all

I am facing the same error. I had python installed outside VS and uninstalled it after reading this thread. But the problem still remains.

Then you shouldn’t have any problem.

I am very sorry. I forgot to mention something. When I built ROOT on Windows, it showed 1 error and it was a linker error for python (something related to x64 and x86, since my python version installed was x64). Before building, I installed the pre-compiled binary root_v6.18.04.win32.vc16.debug.exe and then also, the same error was displayed. Here is the build log:

1>------ Build started: Project: TestProject, Configuration: Debug Win32 ------
1>TestProject.cpp
1>C:\ROOT\root-6.18.04\include\ROOT\RWrap_libcpp_string_view.h(428,34): error C2039: '__find_end': is not a member of 'std'
1>C:\ROOT\root-6.18.04\include\ROOT\RWrap_libcpp_string_view.h(125): message : see declaration of 'std'
1>C:\ROOT\root-6.18.04\include\ROOT\libcpp_string_view.h(193,9): warning C4068: unknown pragma
1>Done building project "TestProject.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Is the precompiled binary also compiled with python?

Yes. But FYI, PyROOT doesn’t work on Windows (not yet)

What do you suggest I should do now?

Try to build from source, disabling Python

Or try to install 32 bit Python (ROOT is only 32bit on Windows)

I am trying with 32 bit python. Also, is there any way to make to ROOT build process a little less demanding on the memory? My laptop is not high-end. I can let the build process happen as long as it takes but I want to be able to use my laptop to do other things. I am using cmake-gui.

Well, the only way I can think of is to use this command:

cmake --build . --config [Debug/Release] -- /maxcpucount:[1,2,3,...]

In the x86 VS command prompt, with /maxcpucount being the number or processors you want to use for the build. There is no way to control the memory