LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   libstdc++ : circular dependencies? (https://www.linuxquestions.org/questions/linux-software-2/libstdc-circular-dependencies-373967/)

yekrahs 10-17-2005 11:52 AM

libstdc++ : circular dependencies?
 
_PREAMBLE_:
I recently tried to install TSE3 (as part of pckg dependency for Noteedit music software).

It said it needed
libstdc++.so.6(GLIBCXX_3.4.5)

So I searched that on http://www.rpmfind.net and http://rpm.pbone.net
and they suggested:
libstdc++-4.0.1-4.fc4.i386.rpm

*PROBLEM*:
When I tried to intsall this libstdc++ package, it said that it was dependent on the package libstdc++!!
How can a package be dependent on itself???
Exact dependency message:
libstdc++ required by (‘libstdc++-devel’, ‘4.0.0’, ‘8’)
libstdc++ required by (‘gcc-c++’, ‘4.0.0’, ‘8’)



So was libstdc++-4.0.1-4.fc4.i386.rpm the right package I needed for libstdc++.so.6(GLIBCXX_3.4.5), as the rpm search websites suggested? Or where else can I get it? And why am I getting these circular dependencies? What's going on?


+++Will Someone *please* dig me out of this hole!+++
(I've been trying to get NoteEdit working for weeks: there's always some other dependency! Compiling it from source failed: it only recognises gcc3 or gcc2, while fc4 comes with gcc4)

PS. Before you ask, I'd use yum to install NoteEdit and all these other packages, but I don't have the internet on my home computer.

All help appreciated.

foo_bar_foo 10-17-2005 03:59 PM

libstdc++ is a part of the compiler gcc

Quote:


It said it needed
libstdc++.so.6(GLIBCXX_3.4.5)



that doesn't make any sense as glibc does not contain libstdc++
although libstdc is linked to glibc like everything else
also current state of developement of glibc is 2.3.5 and there is no glibc 3.4.5
also libstdc++.so.6 is just a symbolic link to libstdc and it exists for older compilers as well

Quote:


Compiling it from source failed: it only recognises gcc3 or gcc2, while fc4 comes with gcc4



what do you mean it only recognises ?
what are the exact error messages
what you are saying is i have to upgrade my compiler to run something that only compiles on older compilers. That's a huge contradiction.
if the fedora people can compile it on gcc4 then so can you

spooon 10-17-2005 04:15 PM

Re: libstdc++ : circular dependencies?
 
Quote:

Originally posted by yekrahs
*PROBLEM*:
When I tried to intsall this libstdc++ package, it said that it was dependent on the package libstdc++!!
How can a package be dependent on itself???
Exact dependency message:
libstdc++ required by (‘libstdc++-devel’, ‘4.0.0’, ‘8’)
libstdc++ required by (‘gcc-c++’, ‘4.0.0’, ‘8’)

You have some gcc 4.0.0 packages that requires libstdc++ version 4.0.0 exactly (so causes problems when you update libstdc++). You should do "yum update libstdc++" or "yum update" so that it updates all relevant packages.

General 10-17-2005 04:32 PM

You can install multiple packages at the same time in this sort of situation:
$ rpm -Uvh package1.rpm package2.rpm package3.rpm

tuxdev 10-17-2005 06:42 PM

the easy way would be to copy it out of an openoffice.org installation.

yekrahs 10-18-2005 09:13 AM

response to foo_bar_foo
 
*MOST OF THE BELOW IS IRRELEVANT. But then I had to respond to foo_bar_foo. I guess there's a time to provide extra background detail, and a time not to (I guess this my first post should have been the second type). THE REAL ISSUE is that I'm just trying to get the libstdc++ package to install, WITHOUT USING *YUM*, as I don't have the internet on my home computer

So please skip to the next post if this one is too long...



Thank you foo_bar_foo, but I think you've mixed up GLIBCXX_3.4.5 with GLIBC: I think they're different.
AS you said, the

"current state of developement of glibc is 2.3.5 and there is no glibc 3.4.5"

...so GLIBCXX is something different entirely: its current development is GLIBCXX 3.4.5.
Part of what the libstdc++ package provides is GLIBCXX, which is the whole reason I was trying to download libstdc++, to get this GLIBCXX 3.4.5, as the package manager told me. It DOES make sense, honestly: try this link below from rpm.pbone.net, you'll see that GLIBCXX_3.4.5 is provided by libstdc++ ('bout halfway down)
http://rpm.pbone.net/index.php3/stat....i386.rpm.html

Quote:

also libstdc++.so.6 is just a symbolic link to libstdc and it exists for older compilers as well
I know, but when I tried to install this tse3 package, the libstdc version I have clearly isn't new enough.

Quote:

what you are saying is i have to upgrade my compiler to run something that only compiles on older compilers. That's a huge contradiction. if the fedora people can compile it on gcc4 then so can you
You misunderstand me here a little... I'm not trying to get a newer version of libstdc so that I can compile this software. This libstdc++ is a package dependency. I've given up trying to compile noteedit, the libstdc++ package has nothing to do with it. The only reason I mentioned it is so nobody tells me to "go and compile it", becuase I _have_ tried to. The libstdcc is a dependency of the tse3 rpm.
For some reason, the noteedit tarball that was made will only recognise gcc3 and gcc2. Don't ask me why. HOWEVER, as a completely separate and totally different issue, the noteedit rpm is dependent on the tse3 rpm, which is dependent on a new version of libstdc++.

Does that make sense?
The only reason I can think of that the fedora people were able to compile it is if they were using an older version of tse3, which does not require the new libstdc++

yekrahs 10-18-2005 09:32 AM

Thank you all, but I think I've realised the real problem...

I have libstdc++-4.0.0-8 installed on my computer, so I realised I have 4.0.0 exactly already (I forgot to put that down, sorry spooon).

Libstdc++-4.0.0-8 only comes with GLIBCXX_3.4.4, and I need 3.4.5. But as I said, when I manually try and install a slightly newer package, e.g. 4.0.1-4, it says I need '4.0.0' '8', which is the 4.0.0-8 package that I already have installed!!! Why won't it upgrade?

There are lots of programs that use libstdc (as I found when I tried to rpm -e uninstall and reinstall it), and they're running fine, so it can't be that fedora isn't recoginsing it for some reason.

***I'd really love to get yum to do it all for me, but as I said spooon, I don't have the internet on my home computer.
***I'm also not quite sure what you mean, General. How would that help me?

***Thank you also tuxdex, but I have the rpm that I want already (straight off the official fedora download server, and I aready have Open Office 2.0 installed)



------> So, does anyone know why this is happening? Why does the newer version of libstdc++ say I need this older version, when I have it installed already? Has no-one else using fedora encountered this problem?!!!

tuxdev 10-18-2005 11:39 AM

I just think it is Fedora madness. You should almost never need to upgrade gcc or glibc and if you really do, dependencies are practically meaningless cause you get into a chicken-or-the-egg problem that you are currently experiencing.

A little more elaboration on my original instruction:
The general idea is to get the libstdc++.so.6 file into a location that ld and ldconfig can find. Therefore, you need to do something like
Code:

cp /opt/OpenOffice2/program/libstdc++.so.6 /usr/local/lib
the directories might be different cause Fedora likes putting things in odd places. I just keep the file somewhere I know cause it is kinda rare and I don't want to go searching for it again. I generally do the same for most of the files that I have to go looking around for.

spooon 10-18-2005 01:17 PM

Quote:

Originally posted by yekrahs
I have libstdc++-4.0.0-8 installed on my computer, so I realised I have 4.0.0 exactly already (I forgot to put that down, sorry spooon).

Libstdc++-4.0.0-8 only comes with GLIBCXX_3.4.4, and I need 3.4.5. But as I said, when I manually try and install a slightly newer package, e.g. 4.0.1-4, it says I need '4.0.0' '8', which is the 4.0.0-8 package that I already have installed!!! Why won't it upgrade?

It won't upgrade because "libstdc++-devel" and "gcc-c++" version 4.0.0 both want the 4.0.0 version of libstdc++. You can get the updated versions of these packages also and try to update the three of them at the same time.

foo_bar_foo 10-18-2005 03:17 PM

like i said before -- all of this is just gcc package and nothing more.
__GLIBCXX__ is just a macro name in the gcc source code.
used to be __GLIBCPP__ in earlier versions.

you can compile a new gcc in /opt and copy the libs like tuxdev says
the link libstdc++.so.6 will be a problem

you can put a needed lib in the same directory as an executable and put a "./" at the start of LD_LIBRARY_PATH and it will use said lib so that is a solution.

It is extreemly important to realize irregardless of the lame crap put out by fedora there absolutely is no package or library GLIBCXX ! you are talking about gcc here. You can have compatability libs on yoou system for running apps compiled with a different compiler but they can't all be linked to libstdc++.so.6.

it sounds like fedora sucks

tuxdev 10-18-2005 03:32 PM

I don't think he needs to recompile gcc. When I did the copy in Slackware, NoteEdit and Xfe worked fine without any gcc related problems. Not sure what Fedora brings to the equation, but it can't be so bad that he has to recompile gcc.

foo_bar_foo 10-18-2005 08:58 PM

Quote:

Originally posted by tuxdev
it can't be so bad that he has to recompile gcc.
not recompile system gcc.
i mean compile other newer/older versions of gcc needed to get the libs
this is the common way to do it for compatability.
that must be what you get when you download versions of precompiled libstdc++
or appearently install openoffice with your distribution.
Quote:


But as I said, when I manually try and install a slightly newer package, e.g. 4.0.1-4, it says I need '4.0.0' '8', which is the 4.0.0-8 package that I already have installed!!! Why won't it upgrade?

it won't upgrade cause you can't fart around with gcc libs without making it so everything is broken.
so Fedora has not figured out how to have these various libs that all are linked to libstdc++.so.6
coexist if it is even possible

this solution
Quote:


cp /opt/OpenOffice2/program/libstdc++.so.6 /usr/local/lib

if in fact that is somehow the proper libstdc++ he will then have two libstdc++.so.6 -- one in /usr/lib and one in /usr/local/lib
this could work with constant wrangling with LD_LIBRARY_PATH
this is the same as compiling the libs yourself if the version is correct
with more constant wrangling with LD_LIBRARY_PATH because of two libstdc++.so.6

it really should be the distribution that compiles a bunch of gcc versions but what it seems is a garbled mess from fedora with confusing/vague and/or misleading error messages.

The real problem is trying to install a binary compiled with a newer compiler than is the one used by the system and that is what the rpm messages should be saying to you so you understand.
you can't upgrade your compiler without borking everything.
NEW ERROR MESSAGE
(can't install gcc 4.0.1 because everything on your system is compiled with gcc-4.0.0 and we havn't figured out how to have the two coexist yet)

two solutions:
1) compile the program with the proper compiler
(this is obviously the correct solution for open source apps)
so we should be talking about how to compile TSE3

2) compile or download or copy newer libs as tuxdev said from newer compiler
(something that only seems correct for proprietary binary only no access to sourcecode situations)

yekrahs 10-19-2005 06:16 AM

Hmmm... I get now that the libstdc++ package was all part of the gcc compiler, and that my gcc4.0.0 is too old.
AS to the two solutions:

2) I'm not sure I'd be able to compile the newer 4.0.1 version of gcc in a different location to my gcc4.0.0 system compiler without borking everything.

Also, although copying across the newer 4.0.1version of libstdc++.so.6 from openoffice to a different folder from my existing libstdc++.so.6 would be a good solution, it'd be too fiddly for me: I wouldn't be able to competently wrangle with LD_LIBRARY_PATH.


So I think'll I have to try compiling again. Stupid Fedora. Perhaps I should submit a report, becuase this is a serious programming flaw... (Would I have had this problem by the way if I'd installed Noteedit using yum? Would it have updated my gcc to 4.0.1, or what would have happened?).



*HERE'S THE REASON I DIDN'T COMPILE*:
(besides the fact that I avoid messing with sourcecode when I can help it)
AS I said, compiling tse3 itself wasn't a problem, just compiling noteedit was. It only recognises gcc2 or gcc3. However, somebody *did* post a patch for using it on gcc4 on the noteedit website, but there was no instructions there, and I don't know what to do with it.

The link to the patch is on this page: http://developer.berlios.de/patch/?group_id=2232
Basically, what is this patch? Is it a list of instructions? Do I have to copy the contents of this file somewhere? etc.

Here's the patch itself:


diff -Naur noteedit-2.8.0-orig/configure noteedit-2.8.0/configure
--- noteedit-2.8.0-orig/configure 2005-07-11 19:17:01.000000000 +0200
+++ noteedit-2.8.0/configure 2005-09-02 14:24:01.000000000 +0200
@@ -31041,6 +31041,14 @@
_ACEOF

rm -f compvers.cc compvers.o compvers
+ elif test "X$ccversion" = "X4"
+ then
+
+cat >>confdefs.h <<\_ACEOF
+#define GCC_MAJ_VERS 4
+_ACEOF
+
+ rm -f compvers.cc compvers.o compvers
else
echo ""
echo "Cannot determine g++ version"

tuxdev 10-19-2005 10:09 AM

you have to run patch
Code:

patch -p(n) < gcc4.patch
(n) represesents a strip number, probably 0, but may be 1.
You should only need to copy libstdc++.so.6 anywhere in your ld path though. And the problems with .so files in Fedora are by design, a really bad design.

yekrahs 10-20-2005 07:41 AM

Thank you v much.

I didn't know Fedora had these problems. I picked it because it was a mainstream distribution (and because you can get a "For Dummies" book for it!), and because I'd heard it's not to bad for newtorking, which I may need at some point in the future.

I'm guessing other main distros don't have these issues?
I might switch to Debian, though I don't like the fact that it uses all completely non-commercial software... I'd use MEPIS instead for this, but my computer is too old.


All times are GMT -5. The time now is 09:39 PM.