c++ compiler not working....even build essential package not getting loaded
hi,
i am trying to compile my c++ program but the compiler is not working. below is the terminal window transcripts
anees@anees-
The program 'g++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>
anees@anees-
The program 'c++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>
please help me to resolve this...
thanks,
anees
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- marcobra (Marco Braida)
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
here is other transcript from terminal window
anees@anees-
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package build-essential has no installation candidate
Revision history for this message
|
#2 |
can anyone please help me in this, i am trying for it for last 3 hours.... :(
Revision history for this message
|
#3 |
Can you give the output of:
lsb_release -a; uname -a
Thanks
Revision history for this message
|
#4 |
this was the output...
anees@anees-
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
Linux anees-laptop 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:09:46 UTC 2011 i686 GNU/Linux
anees@anees-
Revision history for this message
|
#5 |
Please try:
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get upgrade
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get --reinstall install build-essential
Revision history for this message
|
#6 |
i got this...
anees@anees-
[sudo] password for anees:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
anees@anees-
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
anees@anees-
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
anees@anees-
anees@anees-
Err http://
Could not connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Unable to connect to security.
Err http://
Could not connect to archive.
Ign http://
Err http://
Could not connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Err http://
Unable to connect to archive.
Ign http://
Ign http://
Ign http://
Ign http://
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
Err http://
Unable to connect to in.archive.
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
E: Some index files failed to download, they have been ignored, or old ones used instead.
anees@anees-
Please help...
Revision history for this message
|
#7 |
Change from the india server to the main (or any other server), looks like it's currently unavailable, then retry
Revision history for this message
|
#8 |
Please change server go to main server using the software-center options and retry...
Revision history for this message
|
#9 |
when i did it to main server its coming like this
anees@anees-
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dpkg-dev fakeroot g++ g++-4.4 libstdc++6-4.4-dev patch xz-utils
Suggested packages:
debian-keyring debian-maintainers g++-multilib g++-4.4-multilib
gcc-4.4-doc libstdc++6-4.4-dbg libstdc++6-4.4-doc diffutils-doc
The following NEW packages will be installed:
build-essential dpkg-dev fakeroot g++ g++-4.4 libstdc++6-4.4-dev patch
xz-utils
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,572kB of archives.
After this operation, 24.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
libstdc+
fakeroot
Install these packages without verification [y/N]? y
Err http://
Could not connect to archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to archive.
Err http://
Unable to connect to archive.
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
and still not working..
Revision history for this message
|
#10 |
one more thing, i am using proxy server, is it that it could not connect to internet through terminal window ?
though i am using internet through browser on same system....
please let me know if there can be a problem in internet connection.
Revision history for this message
|
#11 |
yes is due your proxy settings please add a file into your system replace the
http://
echo 'Acquire::http { Proxy "http://
Revision history for this message
|
#12 |
Hi,
i couldn't get how to proceed with above steps. can you please let me know in detailed way.
thanks....
Revision history for this message
|
#13 |
Please tell your proxy setting:
http_address
http_port
Revision history for this message
|
#15 |
Open a terminal and copy and paste the row below from here to terminal then press enter:
gksudo gedit /etc/apt/
Acquire::http { Proxy "http://
save exit and try...
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get --reinstall install build-essential
Revision history for this message
|
#16 |
Hi,
I just edited the 01proxy file and added the below lines
Acquire::http { Proxy "http://
and then executed sudo apt-get update commonds. in starting it ran fine but...
i got as below
anees@anees-
[sudo] password for anees:
Ign http://
Ign http://
Ign http://
Err http://
Connection timed out
Ign http://
Err http://
Connection timed out
Ign http://
Ign http://
Err http://
Connection timed out
Ign http://
Err http://
Connection timed out
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Ign http://
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
Connection timed out
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
Connection timed out
Err http://
407 Proxy Authentication Required
Err http://
Connection timed out
Err http://
407 Proxy Authentication Required
Err http://
Connection timed out
Err http://
407 Proxy Authentication Required
Err http://
Connection timed out
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
Err http://
407 Proxy Authentication Required
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
W: Failed to fetch http://
E: Some index files failed to download, they have been ignored, or old ones used instead.
please help...
thanks
anees
Revision history for this message
|
#17 |
So you need proxy user and password please put it into row below replace the "proxyusername:
and put it into the
file.
Open a terminal and copy and paste the row below from here to terminal then press enter:
gksudo gedit /etc/apt/
Acquire::http { Proxy "http://
save exit and try...
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get --reinstall install build-essential
Revision history for this message
|
#18 |
one more thing, in my proxy password i have one '@' sign. Will that cause any issue???
Revision history for this message
|
#19 |
Hey, i changed the proxy password and now its working with above settings.... :) :) :)
Thanks you guys for the help...
Revision history for this message
|
#20 |
Thanks marcobra (Marco Braida), that solved my question.
Revision history for this message
|
#21 |
/* write a prog to take the name of the user and output it with a thank you stamement*/
#include<iostream>
using namespace std;
int main()
{
char ch[20];
cout<<"enter your name pls"<<endl;
cin >> ch>>endl;
cout<<"thank you::"<<ch<<endl;
return 0;
}
output is::::
ff@ff-desktop:
2.cpp: In function ‘int main()’:
2.cpp:9: error: no match for ‘operator>>’ in ‘std::operator>> [with _CharT = char, _Traits = std::char_
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
/usr/include/
ff@ff-desktop:
can any1 pls tell me whats wrong???
Revision history for this message
|
#22 |
Try changing:
#include <iostream>
to:
#include "iostream"
or try:
#include <iostream.h>
or:
#include "iostream.h"
Revision history for this message
|
#23 |
here is the output for the same prog above......when i tried "iostream.h" and <iostream.h>
2.cpp:2:21: error: iostream.h: No such file or directory
2.cpp: In function ‘int main()’:
2.cpp:8: error: ‘cout’ was not declared in this scope
2.cpp:8: error: ‘endl’ was not declared in this scope
2.cpp:9: error: ‘cin’ was not declared in this scope