473,395 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

libstdc++.so.5 vs. libstdc++.so.6 and externa libraries

Hi -
I'm creating an application for a communications network that
needs to be portable between at least Mandrake Linux 10 and Solaris 9
(obviously, the more portable, the better). I realized shortly into the
development process that I was using gcc 3.3.2 on the linux machine,
and gcc 3.4.0 on my solaris machines. I upgraded gcc to 3.4 on the
linux machine, but now am having issues involving libstdc++.so.5 and
libstdc++.so.6

The first issue is that an external library (SocketW -
http://www.digitalfanatics.org/cal/socketw/ ) that I am using seems to
depend on libstdc++.so.5 specific features, and will not compile using
libstdc++.so.6. If I leave both shared objects linked to, then gcc
issues a warning everytime I make the application (this isn't too bad,
I can deal with warnings, if they don't actually cause an issue)

The second problem may or may not be related. I wrote the entire
program on the linux machine, compiled and ran it just fine. One of the
classes in the program uses the stl queue class. Again, this worked
fine on linux, but when I tried to compile on the solaris machines, I
get this error (it actually occurs twice, once for each queue I'm
declaring):

error: ISO C++ forbids declaration of `queue' with no type
error: expected `;' before '<' token

Any help would be greatly appriciated - I can, of course, put up more
information if it would be helpful in solving these issues.
Chris Phillips

Jul 22 '05 #1
4 3812
an**********@hotmail.com wrote:
[...] I upgraded gcc to 3.4 on the
linux machine, but now am having issues involving libstdc++.so.5 and
libstdc++.so.6
This is beyond the scope of this newsgroup. We deal with the
language, not with a particular standard library implementations.
The first issue is that an external library [...]
Can't help you there, try a gnu.g++.help newsgroup or a newsgroup
for Linux or Solaris (or both).
The second problem may or may not be related. I wrote the entire
program on the linux machine, compiled and ran it just fine. One of the
classes in the program uses the stl queue class. Again, this worked
fine on linux, but when I tried to compile on the solaris machines, I
get this error (it actually occurs twice, once for each queue I'm
declaring):

error: ISO C++ forbids declaration of `queue' with no type
error: expected `;' before '<' token
For what code?
Any help would be greatly appriciated - I can, of course, put up more
information if it would be helpful in solving these issues.


FAQ 5.8.

Victor
Jul 22 '05 #2
an**********@hotmail.com wrote:
The first issue is that an external library (SocketW -
http://www.digitalfanatics.org/cal/socketw/ ) that I am using seems to
depend on libstdc++.so.5 specific features, and will not compile using
libstdc++.so.6.
you mean gcc-3.(3|4), not libstdc++.so.(5|6)
it probably means that it is not standard c++, and that g++-3.3 was more
lenient than g++-3.4.
If I leave both shared objects linked to, then gcc
issues a warning everytime I make the application (this isn't too bad,
I can deal with warnings, if they don't actually cause an issue)
Never got a crash because of that here, but hey, you never know...
error: ISO C++ forbids declaration of `queue' with no type
Do you have these two lines in your file?
#include <queue>
using std::queue;
Any help would be greatly appriciated - I can, of course, put up more
information if it would be helpful in solving these issues.


As was said, a gcc newsgroup knows best about gcc...
Jul 22 '05 #3
> > The second problem may or may not be related. I wrote the entire
program on the linux machine, compiled and ran it just fine. One of the
classes in the program uses the stl queue class. Again, this worked
fine on linux, but when I tried to compile on the solaris machines, I
get this error (it actually occurs twice, once for each queue I'm
declaring):

error: ISO C++ forbids declaration of `queue' with no type
error: expected `;' before '<' token


For what code?


Here's the declaration that will compile on the linux machine, but not
on the solaris machines:

queue<char *> myqueue;

Interestingly enough, when I made a test class and ran it, queue's
worked fine. Is there some other header (from the list below maybe?)
that is known not to work with queue. Also, other stl containers seem
to want to work fine, I've tried deque and priority_queue - but I'd
much prefer to stick with queue.

Here's the list of headers included:
#include <queue>
#include "messages.h"
#include "SocketW.h"
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <iostream>

Thanks!
Jul 22 '05 #4
Chris Phillips wrote:
The second problem may or may not be related. I wrote the entire
program on the linux machine, compiled and ran it just fine. One of the
classes in the program uses the stl queue class. Again, this worked
fine on linux, but when I tried to compile on the solaris machines, I
get this error (it actually occurs twice, once for each queue I'm
declaring):

error: ISO C++ forbids declaration of `queue' with no type
error: expected `;' before '<' token
For what code?

Here's the declaration that will compile on the linux machine, but not
on the solaris machines:

queue<char *> myqueue;


This declaration will not compile _by_itself_ because 'queue' has not
been defined.
Interestingly enough, when I made a test class and ran it, queue's
worked fine. Is there some other header (from the list below maybe?)
that is known not to work with queue. Also, other stl containers seem
to want to work fine, I've tried deque and priority_queue - but I'd
much prefer to stick with queue.

Here's the list of headers included:
#include <queue>
#include "messages.h"
#include "SocketW.h"
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <iostream>


The list above includes two standard headers (<queue> and <iostream>)
and a bunch of non-standard (probably compiler- and OS-specific) ones.
C++ makes no claims WRT other headers. Try the newsgroup for your
compiler and/or OS.

Could it be that you're missing the fact that all standard containers
are declared in the namespace 'std'? What compiler are you using on
Linux? Could it be gcc 2.95.x? That's too old. Update your compiler
and make your code up to snuff WRT the C++ language. You can find more
information on 'std' namespace in any C++ book released after 1998. I
recommend "Accelerated C++". Also, a book on Standard Library wouldn't
hurt. Try "The C++ Standard Library" by Josuttis. It's the best there
is.

Victor
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fritz Schmidt | last post by:
Hi, I tried to install some small tools for linux.. for one tool i needed libstc+++.so.2.10 ... so in installed it into my /usr/lib but when i then tried to launch ./php i got this error:...
5
by: VoiD | last post by:
Aloha! I'm looking for libstdc++ documentation. I've been searching the net for last 2 days! The best thing I can imagine is a downloadable function and class index with at least short...
0
by: Bit Gossip | last post by:
I find really difficult to understand the doxygen documentation on www.gnu.org. Can someone suggest me some good and easily readable doc or book for libstdc++ V3? Are there man pages available...
3
by: Jürgen Tiedemann | last post by:
Diesen Beitrag setze ich für André Hitzschke ein: Hallo, ich habe ne Frage zu den ganzen "autotools" um das configure-Skript etc. zu erstellen. "autoscan" hat festgestellt, dass die Library...
1
by: Doctor Bones | last post by:
PLease help. I have a decent amount of C++ experience on Windows, but know nothing about Unix. I wrote a simple "Hello World" program on a Solaris box which includes <iostream>. The program...
2
by: ddh | last post by:
Hi, I download mingw in my system(XP SP2), and extract them in c:\mingw\gcc, so the directories looks like: c:\mingw\gcc\bin, c:\mingw\gcc\include ..., and I added c:\mingw\gcc\bin in my PATH...
4
by: faria | last post by:
Hi, I would like if somedy has had problem with GNU libstdc++ with 64 bits ? Sometimes I have got a bus error at libstdc++ with gcc 3.4.2 in SUN. I have used a multithread 64 bits...
1
by: VincentWen | last post by:
I am using g++ 3.3.4, and the default libstdc++ version is libstdc++.so.5.0.6,but for some reason, I must use libstdc++-libc6.2-2.so. how could I use the other version libstdc++ library ? I...
3
by: AndreyS | last post by:
Hi everyone, I am relatively new to C++ and trying to write a program during which I need to generate random numbers with uniform distribution. On g++'s site - the compiler I am using - (version...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.