vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

GLIBC 2.18 dependency

Open delmyers opened this issue 10 years ago • 65 comments

This was copied from the reviews on the extension page. Not sure if it is a language service issue, or a debugger issue.

delmyers avatar Apr 19 '16 23:04 delmyers

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)

Ebiroll avatar May 16 '16 10:05 Ebiroll

I verified that the Debugger works on CentOS. @sridmad , I think this is a language service issue.

pieandcakes avatar Jul 23 '16 00:07 pieandcakes

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)

bfarley792 avatar Aug 02 '16 15:08 bfarley792

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.

desimonk avatar Sep 15 '16 01:09 desimonk

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 avatar Sep 15 '16 02:09 desimonk

@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?

delmyers avatar Sep 15 '16 03:09 delmyers

Same story here. Preventing me from really using on RHEL7.2

mk3890 avatar Sep 20 '16 14:09 mk3890

For those that would like to run vscode-cpptools on CentOs/RHEL 7 while we wait for devs to address this issue.

  1. 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.

  2. 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

  1. 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'; "

ampatel21 avatar Sep 21 '16 12:09 ampatel21

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

Ebiroll avatar Sep 22 '16 16:09 Ebiroll

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.

ericgross2 avatar Oct 17 '16 22:10 ericgross2

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.

s-martin avatar Nov 23 '16 09:11 s-martin

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:

  1. wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.xz
  2. tar xvf glibc-2.18.tar.xz
  3. cd glibc-2.18
  4. mkdir build
  5. cd build
  6. ../configure --prefix=/opt/glibc-2.18
  7. sudo make install
  8. 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  
  1. 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)
  1. 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'; "

Ebiroll avatar Dec 10 '16 01:12 Ebiroll

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.

s-martin avatar Dec 12 '16 07:12 s-martin

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?

Ebiroll avatar Dec 12 '16 17:12 Ebiroll

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

fradav avatar Mar 15 '17 12:03 fradav

So is the src.rpm available anywhere? I'd greatly prefer recompiling vscode for GLIBC 2.16 rather than roll my own newer version.

ianwestc avatar Jun 30 '17 17:06 ianwestc

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 avatar Jul 12 '17 19:07 rachellixie

@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 avatar Jul 12 '17 19:07 sean-mcmanus

@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 avatar Jul 12 '17 19:07 rachellixie

@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.

sean-mcmanus avatar Jul 12 '17 20:07 sean-mcmanus