LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-13-2007, 03:52 PM   #1
sroberts82
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
Installing GCC


Hi I have Suse 10.1 on my server but it doesn't have gcc so I'm trying to install it, but I'm struggling. These are the packages I have installed:

cpp-3.3.3-1.i686.rpm
libstdc++-3.3.3-1.i686.rpm
gcc-3.3.3-1.i686.rpm
gcc-objc-3.3.3-1.i686.rpm
libgcj-devel-3.3.3-1.i686.rpm
libstdc++-devel-3.3.3-1.i686.rpm
gcc-c++-3.3.3-1.i686.rpm
libgcc-3.3.3-1.i686.rpm
libobjc-3.3.3-1.i686.rpm

However, when I went to put in libstdc++-3.3.3-1.i686.rpm I get this:

Code:
        package libgcc-4.1.0-25 (which is newer than libgcc-3.3.3-1) is already installed
        file /lib/libgcc_s.so.1 from install of libgcc-3.3.3-1 conflicts with file from package libgcc-4.1.0-25
So I left it alone. So I thought I should have everything...so I tried to compile hello world:

Code:
#include <iostream>

using namespace std;

int main(void)
{
cout <<"hello"<<endl;
return 0;
}
But this is what Im getting and I can't figure out whats up:

Code:
In file included from /usr/include/c++/3.3.3/i686-redhat-linux/bits/c++config.h:35,
                 from /usr/include/c++/3.3.3/iostream:44,
                 from hello.cpp:1:
/usr/include/c++/3.3.3/i686-redhat-linux/bits/os_defines.h:39:22: features.h: No such file or directory
/usr/include/c++/3.3.3/i686-redhat-linux/bits/os_defines.h:46:23: gnu/types.h: No such file or directory
In file included from /usr/include/c++/3.3.3/i686-redhat-linux/bits/c++config.h:35,
                 from /usr/include/c++/3.3.3/iostream:44,
                 from hello.cpp:1:
/usr/include/c++/3.3.3/i686-redhat-linux/bits/os_defines.h:47: error: syntax
   error before `;' token
In file included from /usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/3.3.3/iosfwd:46,
                 from /usr/include/c++/3.3.3/ios:44,
                 from /usr/include/c++/3.3.3/ostream:45,
                 from /usr/include/c++/3.3.3/iostream:45,
                 from hello.cpp:1:
/usr/include/c++/3.3.3/clocale:49:20: locale.h: No such file or directory
In file included from /usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/3.3.3/iosfwd:46,
                 from /usr/include/c++/3.3.3/ios:44,
                 from /usr/include/c++/3.3.3/ostream:45,
                 from /usr/include/c++/3.3.3/iostream:45,
                 from hello.cpp:1:
/usr/include/c++/3.3.3/clocale:57: error: `lconv' not declared
/usr/include/c++/3.3.3/clocale:58: error: `setlocale' not declared
/usr/include/c++/3.3.3/clocale:59: error: `localeconv' not declared
In file included from /usr/include/c++/3.3.3/iosfwd:46,
                 from /usr/include/c++/3.3.3/ios:44,
                 from /usr/include/c++/3.3.3/ostream:45,
                 from /usr/include/c++/3.3.3/iostream:45,
                 from hello.cpp:1:
/usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:42:47: langinfo.h: No such file or directory
/usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:43:68: iconv.h: No such file or directory
/usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:44:48: libintl.h: No such file or directory
In file included from /usr/include/c++/3.3.3/iosfwd:46,
                 from /usr/include/c++/3.3.3/ios:44,
                 from /usr/include/c++/3.3.3/ostream:45,
                 from /usr/include/c++/3.3.3/iostream:45,
                 from hello.cpp:1:
/usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:59: error: syntax
   error before `;' token
/usr/include/c++/3.3.3/i686-redhat-linux/bits/c++locale.h:73: error: parse

and so on...
Can someone please help me? Its driving me mad....

Thank you in advance
Stephen
 
Old 10-13-2007, 04:12 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
install gcc 4.1.0. that shoudl clear it up as part of it is already on there. should be sitting there on your distro cd's waiting for you.
 
Old 10-13-2007, 06:54 PM   #3
sroberts82
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
install gcc 4.1.0. that shoudl clear it up as part of it is already on there. should be sitting there on your distro cd's waiting for you.

Hi Chris,
I dont actually have the CD and I can't seem to find the RPMs anywhere...could you point me in the right direction?

I'm a newbie (obviously) but I dont get the initial use of gcc source. How do you compile without a compiler??
 
Old 10-13-2007, 10:59 PM   #4
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
If you go to RPM Search and put gcc-4.1.0-25 in the search field, you'll get links to the packages which are for Open Suse. The package you have installed --> libgcc-4.1.0-25, is also for Open Suse acording to RPM Search.
 
Old 10-14-2007, 07:05 AM   #5
sroberts82
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Ive managed to install all what I thought I needed but now I'm getting these errors:

Code:
# gcc hello.cpp
hello.cpp:9:2: warning: no newline at end of file
/tmp/ccfq9VLJ.o: In function `__static_initialization_and_destruction_0(int, int)':
hello.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccfq9VLJ.o: In function `__tcf_0':
hello.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccfq9VLJ.o: In function `main':
hello.cpp:(.text+0x8e): undefined reference to `std::cout'
hello.cpp:(.text+0x93): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
hello.cpp:(.text+0x9b): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
hello.cpp:(.text+0xa3): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccfq9VLJ.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Any ideas? Is it a library issue?
Thanks,
 
Old 10-14-2007, 07:15 AM   #6
sroberts82
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sroberts82 View Post
Ive managed to install all what I thought I needed but now I'm getting these errors:

Code:
# gcc hello.cpp
hello.cpp:9:2: warning: no newline at end of file
/tmp/ccfq9VLJ.o: In function `__static_initialization_and_destruction_0(int, int)':
hello.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccfq9VLJ.o: In function `__tcf_0':
hello.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccfq9VLJ.o: In function `main':
hello.cpp:(.text+0x8e): undefined reference to `std::cout'
hello.cpp:(.text+0x93): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
hello.cpp:(.text+0x9b): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
hello.cpp:(.text+0xa3): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccfq9VLJ.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Any ideas? Is it a library issue?
Thanks,

Apologies, I am a clown

should be

Code:
g++ hello.cpp
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing GCC-- digitalbrush Red Hat 2 12-23-2004 02:19 PM
Installing gcc beep Linux - Software 1 06-12-2004 04:13 PM
installing GCC ganninu Debian 1 11-08-2003 03:31 PM
Installing GCC Bruno Dantas Linux - Newbie 1 09-12-2003 08:37 AM
Installing GCC 3.1 over GCC 2.96...? aaronluke Linux - General 3 09-27-2002 05:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration