1

Everything was right. I have installed gdb from github and installed in /usr/local/bin. After that i removed default gdb(/usr/bin) using the following command

sudo apt-get remove gdb

Now, when try to configure i am getting following errors:

checking whether the C compiler works... no
configure: error: C compiler cannot create executables
See `config.log' for more details

It's look like c compiler issue. But i have gcc,g++ and build-essential installed. Even i did configure and make before the gdb(github) installation. My system is ubuntu 14.04 (64bit). I also found that by including 'O3' in CFLAGS it can be solved. But it's not working for me. Please help.

EDIT

When i try to compile a simple c file using gcc (gcc test.c) i got this error:

/usr/local/bin/ld: this linker was not configured to use sysroots

I also tried to re-install binutils. But it didn't help.

  • Did you check the config.log (in the same directory as the configure script usually); it contains the detailed commands executed to test the compiler. And their output too. You can add them to your question if they didn't help you to solve to problem. – Benoit Jul 7 '14 at 9:12
  • @Benoit I didn't find anything unusual in config.log and it's large enough too(4624 line) – shantanu Jul 7 '14 at 9:18
  • 2
    Have you tried manually gcc ? If you are not a developer, go to this site, paste the code into a file like test.c and execute gcc -o test test.c. Do you get an executable called test which print "Hello world" ? – Benoit Jul 7 '14 at 9:22
  • Where is the source package that you are trying to ./configure located on your system? The cannot create executables message sometimes indicates that the filesystem doesn't support Unix-style permissions (e.g. NTFS). – steeldriver Jul 7 '14 at 9:27
  • @steeldriver It's not NTFS problem. I can assure you that. – shantanu Jul 7 '14 at 9:51
0

I tried to install the latest version of gdb(7.8) in ubuntu. But somehow ld (part of binutil) from gdb package is not supported by ubuntu 14.04. So i have to uninstall it. But there is no gdb uninstall script. So i did the following:

Step 1: edit /etc/environment and move /usr/local/bin to then end of the line. I let the system to load /usr/bin first.

Step 2: update path: source /etc/environment

Step 3: remove gdb files: sudo rm -rf /usr/local/bin/gdb* /usr/local/bin/ld

Step 4: re-install binutils: sudo apt-get install --reinstall binutils

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.