GLIBC 2.18 dependency
This was copied from the reviews on the extension page. Not sure if it is a language service issue, or a debugger issue.
Maybe it is because of `GLIBC_2.18' dependency?
ldd bin/Microsoft.VSCode.CPP.Extension.linux bin/Microsoft.VSCode.CPP.Extension.linux: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by bin/Microsoft.VSCode.CPP.Extension.linux) linux-vdso.so.1 => (0x00007ffc5bb43000)
I verified that the Debugger works on CentOS. @sridmad , I think this is a language service issue.
I'm using RHEL 7, but see the same thing. The debugger works as expected, but I don't have Go to Definition, etc. and .browse.VC.db never gets created. I also see the GLIBC_2.18 error with ldd on the extension (RHEL 7's GLIBC version is 2.17)
Symbol searches or go to definition does not work at all. Language service is not working at all. I am using Centos 7.2 and latest version of VS Code downloaded today. Version of my glibc is 2.17 and I get same error as other user reported about glibc. If anyone worked around this issues please post it.
I just saw that this issue is first opened on April 19, and there is no acknowledgement on this issue. I.e. NO HOPE of being resolved anytime soon. Will go back to eclipse. It is really shame that this is not tested on Centos 7 given it is announced on their website. This kind of false claims often wastes many people's time.
@desimonk I'm sorry to hear that you find our responses to be too slow. Unfortunately, sometimes some issues slip through the cracks as we continue to try to improve the product. We do want to get our extension to work on as many platforms as we can, so thank you for bringing this issue back to our attention.
@sridmad, @greazer: it looks like users are having issues because the language service is linked against glibc 2.18. Is it possible to use a lower version?
Same story here. Preventing me from really using on RHEL7.2
For those that would like to run vscode-cpptools on CentOs/RHEL 7 while we wait for devs to address this issue.
-
Download Src/Build/Install glibc 2.18 onto your system. I got a source rpm from Fedora 20 for glibc-2.18. Make sure to change the install prefix for the library. I picked '/opt/glibc-2.18'. DO NOT FORGET TO CHANGE THE INSTALL PREFIX.
-
Create a bash script file called Microsoft.VSCode.CPP.Extension.linux.sh in "~/.vscode/extension/ms-vscode.cpptools-0.9.1/bin" with the following contents...
#!/bin/bash
/opt/glibc-2.18/lib/ld-linux-x86-64.so.2 --library-path /opt/glibc-2.18/lib:/lib64 ~/.vscode/extensions/ms-vscode.cpptools-0.9.1/bin/Microsoft.VSCode.CPP.Extension.linux
- Modify "~/.vscode/extensions/ms-vscode.cpptools-0.9.1/out/src/LanguageServer/C_Cpp.js"
Change the following line from " extensionsProcessName += '.linux'; " to " extensionProcessName += '.linux.sh'; "
Yes ampatel21 tip works on centos7. I did the following: wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.xz tar xvf glibc-2.18.tar.xz cd glibc-2.18;mkdir build;cd build ../configure --prefix=/opt/glibc-2.18/ make -j su make install Then follow ampatel21:s step 2&3 in previous post.
Version 0.9.2 still have not fixed this issue but also works with step2 and the following contents.. #!/bin/bash
/opt/glibc-2.18/lib/ld-linux-x86-64.so.2 --library-path /opt/glibc-2.18/lib:/lib64:/usr/local/lib64 ~/.vscode/extensions/ms-vscode.cpptools-0.9.2/bin/Microsoft.VSCode.CPP.Extension.linux
Thanks, this workaround worked for me on Scientific Linux 7.2 (still ships with Glibc 2.17 for some reason). The only thing missing from your steps is to make sure to chmod +x the new script.
Thanks, the workaround works for CentOS 7.2. At least I finally get the lightbulb and "Add include path to settings" for my includes. However, so far there was no .browse.VS.code created and go to definition doesn't work properly yet.
With the 0.9.3 it seems that both GLIBC_2.18 & GLIBC_2.17 is required. However if you want a workaround try this:
- wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.xz
- tar xvf glibc-2.18.tar.xz
- cd glibc-2.18
- mkdir build
- cd build
- ../configure --prefix=/opt/glibc-2.18
- sudo make install
- Create a bash script file called Microsoft.VSCode.CPP.Extension.linux.sh in "~/.vscode/extension/ms-vscode.cpptools-0.9.3/bin" with the following contents...
#!/bin/bash
/opt/glibc-2.18/lib/ld-linux-x86-64.so.2 --library-path /opt/glibc-2.18/lib:/lib64:/usr/local/lib64 ~/.vscode/extensions/ms-vscode.cpptools-0.9.3/bin/Microsoft.VSCode.CPP.Extension.linux
- chmod a+x Microsoft.VSCode.CPP.Extension.linux.sh You can try to start it on the comand line ./Microsoft.VSCode.CPP.Extension.linux.sh If it starts silently without errors, then you are fine, otherwise add missing dependencies to the --library-path option in the script, if not you will see something like this,
./Microsoft.VSCode.CPP.Extension.linux: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.18' not found (required by ./Microsoft.VSCode.CPP.Extension.linux)
./Microsoft.VSCode.CPP.Extension.linux: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by ./Microsoft.VSCode.CPP.Extension.linux)
- Modify "~/.vscode/extensions/ms-vscode.cpptools-0.9.3/out/src/LanguageServer/client.js" Change the following line from " extensionProcessName += '.linux'; " to " extensionProcessName += '.linux.sh'; "
Although the provided workarounds fix the issues, are there any plans to address the root cause of this issue?
The workarounds have to be redone every time the cpptools extension is updated.
v 0.9.3 still not working under Centos, unless you use the workaround. For just the Visual studio code ide you only need GLIBC_2.15 Why cannot this extension be compiled in a similar way?
I made a small script to automatize @Ebiroll 's answer there You may have to change the wrapper line and the vscode-oss to vscode, for example
So is the src.rpm available anywhere? I'd greatly prefer recompiling vscode for GLIBC 2.16 rather than roll my own newer version.
I can't get this working on my Ubuntu 12.04 LTS. I have glibc2.15. when I download glibc2.18, and do "../configure --prefix=/opt/glibc-2.18/", it gives me an error: *** These critical programs are missing or too old: ld
anyone can help me? thanks.
@rachellixie Ubuntu 12.04 LTS is no longer a "supported" distribution of Ubuntu. You should upgrade your OS (see https://en.wikipedia.org/wiki/Ubuntu_version_history ).
@sean-mcmanus thanks. I know it's not officially supported. but I can not upgrade now due to our project need. so I want to try the workaround here. is there a way?
@rachellixie From our telemetry, out of the very small number of Ubuntu 12.0.4 users installing our extension, 0 of them were able to successfully use it, so unfortunately, a workaround might not be available.