LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-23-2005, 04:13 PM   #1
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Rep: Reputation: 15
gcc 3.2-7 on FC4 ?


Hi all,

I'm using Open Inventor (3D Graphics API for C++ and Java) of Fedora Core 4. The version of gcc on my machine is gcc 4.0.0-8. When I try to call their demo program I get the following error.

----------------------------------------------------------------------------------------------------------------------
g++ -O -Wno-deprecated -D_GCC_ -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DQT_SHARED -o verifs verifs.o -L/home/oiv50/lib
-lInventorXt -lInventor -limage -L/lib -lGLU -L/lib -lGL
-L/home/oiv50/lib -L/usr/X11R6/lib -L/usr/X11R6/lib -lXm -lXt -lXi
-lXext -L/usr/X11R6/lib -lX11 -lstdc++ -lm -ldl -lpthread
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::allocate(unsigned int)'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::_S_free_list'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::_Lock::~_Lock()'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::_S_force_new'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::_Lock::_Lock()'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::_S_refill(unsigned int)'
/home/oiv50/lib/libInventor.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
>::_S_empty_rep_storage'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::_S_node_allocator_lock'
/home/oiv50/lib/libInventorXt.so: undefined reference to
`std::__default_alloc_template<true, 0>::deallocate(void*, unsigned
int)'
collect2: ld returned 1 exit status
make: *** [verifs] Error 1
----------------------------------------------------------------------------------------------------------------------

I was told that this error is most probably because Open Inventor (the 3D graphics API) was built with gcc 3.2-7 and I'm using 4.0.0-8. I was asked to recompile with demo code with gcc 3.2.7

When I tried to install gcc 3.2.7 rpm, I was not able to do so, because of dependency issues.
----------------------------------------------------------------------------------------------------------------------
[root@linux1 Desktop]# rpm -ivf gcc-3.2-7.i386.rpm
warning: gcc-3.2-7.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
cpp = 3.2-7 is needed by gcc-3.2-7.i386
[root@linux1 Desktop]# gcc cpp-3.2-7.i386.rpm
cpp-3.2-7.i386.rpm: file not recognized: File format not recognized
collect2: ld returned 1 exit status
[root@linux1 Desktop]# rpm -ivf cpp-3.2-7.i386.rpm
warning: cpp-3.2-7.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing packages for installation...
package cpp-4.0.1-4.fc4 (which is newer than cpp-3.2-7) is already installed
file /usr/bin/cpp from install of cpp-3.2-7 conflicts with file from package cpp-4.0.1-4.fc4
file /usr/share/info/cpp.info.gz from install of cpp-3.2-7 conflicts with file from package cpp-4.0.1-4.fc4
file /usr/share/info/cppinternals.info.gz from install of cpp-3.2-7 conflicts with file from package cpp-4.0.1-4.fc4
file /usr/share/man/man1/cpp.1.gz from install of cpp-3.2-7 conflicts with file from package cpp-4.0.1-4.fc4
----------------------------------------------------------------------------------------------------------------------

I would like to know if the first error "undefined reference to `std::__default_alloc_template" is due to the difference in compiler versions and if yes, how can I get gcc 3.2.7 installed.

Also here is the system requirement for provided for open inventor

1.3 PC Linux Red Hat
---------------------------
- Red Hat release: 8.0/9.0
NOTE: Open Inventor was built on Red Hat 8.0 but is fully compatible with Red Hat 9.0.

- OS kernel: 2.4.18-14
- X-server: XFree 4.2.0-72
- Motif: OpenMotif 2.2.2-12
- Compiler: gcc 3.2-7
- C library: glibc 2.2.93-5
- OpenGL library: NVidia driver 53.28 (OpenGL 1.4)
NOTE: This is not the Red Hat 8.0 default: the default is provided by the
X-server.

I have been told that the the API works on RedHat Workstation 3, Fedora Core 3,
and Suse 9.3.

Please advice
Thanks
Senthil
 
Old 08-24-2005, 09:18 AM   #2
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
Use yum:
yum install compat-gcc-32
 
Old 08-24-2005, 11:37 AM   #3
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
Hi,

thanks for the advice. I made a terrible mistake by trying to uninstall gcc4.0.0-8. I removed gcc by using rpm -e and and also 4 more packages which gcc was dependent on. When I tried to install gcc 3.2.7 there were more confilicts. I tried to fix this by running yum update. But now, yum, rpm and gcc, firefox etc are not working.

When I try using gcc I get the following message.

gcc: installation problem, cannot exec cc1plus: No file or directory

when I try yum I get the following

the yum libraries do not seem to be available on your system for this version of python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512] (RedHat 4.0.0-5]
Please make sure the package you used to installyum was built for your install of python.

rpm: error while loading shared libraries: libstdc++.so.6: cannot open shared object file. No such file or directory.

I guess this is all because I screwed up my gcc installation. I neither have gcc-4.0.0-8 nor gcc 3.2.7. I dont want to reinstall FC4. Please help

Thanks
Senthil
 
Old 08-24-2005, 12:15 PM   #4
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
Someone may know a better way, but this should work.

1) Get an alternative rpm2cpio, as the one installed is linked to libdc++.

One can be found here: http://linuxmafia.com/pub/linux/util...neral/rpm2cpio
Download it, and make it executable (chmod +x ..., or use the file manager).

2) Find all rpms you deleted. They should be on the installation media.
3) Open a shell, become root, and type: cd /
4) For each RPM, type: /path/to/rpm2cpio /path/to/foo.rpm | cpio -iumd

Make sure you use the rpm2cpio you downloaded, the one on the system won't work.
 
Old 08-24-2005, 01:12 PM   #5
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
Hi , thanks for your advice. i was able to get my browser, rpm and yum utilities running. The only package I'm not able to run is gcc.

when I try to compile a hello world program in gcc I get the following error .

cannot exec ''cc1plus' No such file or directory.

Please advice
Thanks
Senthil
 
Old 08-24-2005, 01:30 PM   #6
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
You're missing the gcc-c++ package.
 
Old 08-24-2005, 01:52 PM   #7
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
I'm not sure if I'm missing that. I tried

[root@linux1 senthil]# rpm -qa | grep gcc
gcc-c++-4.0.1-4.fc4
gcc-4.0.1-4.fc4
libgcc-4.0.1-4.fc4
gcc-gfortran-4.0.0-8

please advice.

Thanks
Senthil
 
Old 08-24-2005, 02:37 PM   #8
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
That's odd.
yum provides /usr/libexec/gcc/i386-redhat-linux/4.0.1/cc1plus says:
Code:
gcc-c++.i386                             4.0.1-4.fc4            installed
Matched from:
/usr/libexec/gcc/i386-redhat-linux/4.0.1/cc1plus
Does that file exist? If not, you may want to try to reinstall the gcc-c++ package.
 
Old 08-24-2005, 02:59 PM   #9
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
Yes, that file exists.

[senthil@linux1 4.0.1]$ ls -l cc1plus
-rwxr-xr-x 1 root root 5070864 Jul 27 07:50 cc1plus

and here is my $PATH variable
[senthil@linux1 4.0.1]$ echo $PATH
/usr/kerberos/bin:/bin:/usr/sbin:/usr/bin:/etc:/usr/local/bin:/usr/local/netscape:/home/senthil/cvs/bin/linux:/home/senthil/cvs/devbin/linux:.
Please advice
Senthil
 
Old 08-24-2005, 05:33 PM   #10
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
I suggest you try to re-install the gcc rpm's.
Like this: rpm --replacepkgs -ivh <package>
 
Old 08-24-2005, 07:33 PM   #11
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
thanks. I did that. i also reinstalled gcc=g++. Now I'm not getting that error any more. But I'm getting a different one.

/tmp/ccIjFQ2F.o(.text+0x25): In function `main':
helloworld.cxx: undefined reference to `std::cout'
/tmp/ccIjFQ2F.o(.text+0x2a):helloworld.cxx: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccIjFQ2F.o(.text+0x47): In function `__tcf_0':
helloworld.cxx: undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccIjFQ2F.o(.text+0x74): In function `__static_initialization_and_destruction_0(int, int)':
helloworld.cxx: undefined reference to `std::ios_base::Init::Init()'
/tmp/ccIjFQ2F.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

and here is the source of my helloworld.cxx

#include<iostream>
using namespace std;
int main(){
cout<<"Hello World !";
return 0;
}

Please advice.
Thx
Senthil
 
Old 08-25-2005, 04:52 AM   #12
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
Install/re-install libstdc++-devel.
 
Old 08-25-2005, 11:15 AM   #13
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks. I did that. In fact I reinstalled the following packages, not necessarily in this order using

rpm --replacepkgs -ivh <rpmname>

compat-gcc-32-3.2.3-47.fc4.i386.rpm
libgcc-4.0.1-4.fc4.i386.rpm
cpp-4.0.1-4.fc4.i386.rpm
libstdc++-4.0.1-4.fc4.i386.rpm
libstdc++-devel-4.0.1-4.fc4.i386.rpm
gcc-c++-4.0.1-4.fc4.i386.rpm
gcc-4.0.1-4.fc4.i386.rpm

Still I'm getting the follwing error.
-------------------------------------------------------------------------------------------------
/tmp/ccQWM9kd.o(.text+0x25): In function `main':
helloworld.cxx: undefined reference to `std::cout'
/tmp/ccQWM9kd.o(.text+0x2a):helloworld.cxx: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccQWM9kd.o(.text+0x47): In function `__tcf_0':
helloworld.cxx: undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccQWM9kd.o(.text+0x74): In function `__static_initialization_and_destruction_0(int, int)':
helloworld.cxx: undefined reference to `std::ios_base::Init::Init()'
/tmp/ccQWM9kd.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
-------------------------------------------------------------------------------------------------

I'm able to compile and run a helloworld.c code succesfully but I'm not able to use any functions available in the math libarary.

Please adivce
Thx
Senthil
 
Old 08-25-2005, 11:51 AM   #14
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
I get the very same error if I use gcc instead of g++. Which are you using?
As for your problem with math library functions, you have to link in the math library explicitly, using -lm.
 
Old 08-25-2005, 12:05 PM   #15
senthilpr_in
LQ Newbie
 
Registered: Aug 2005
Distribution: FC4 2.6.11-1.1369_FC4smp
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks for help with including hte math library. It works. !!

Also, amazingly I'm able to compile with g++ sucessfully and not gcc (exactly opposite to yours).

Senthil
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Dual Boot Windows XP & FC4 with FC4 already installed kt8993 Linux - General 8 10-18-2006 05:26 PM
FC4/GCC-4 and OpenCV 0.9.7 conflicts... jiapei100 Linux - Software 0 11-03-2005 08:28 PM
Need Two Versions of gcc on FC4 yellowdognerd Linux - Software 9 09-09-2005 01:46 PM
FC4, linux-gate.so.1 is needed by gcc RohanShrivastav Fedora 3 07-15-2005 09:12 AM
Converting a FC4 dvd to FC4 cd set? prem1000 Fedora 2 06-17-2005 03:14 PM


All times are GMT -5. The time now is 01:21 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration