Jeff Stampes | 1 Nov 06:10 2002

Undefined references from libstdc++?


Can anyome point me in the right direction please?  These occur when 
linking in libstdc++

/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::ctype<char>::do_widen(char const*, char 
const*, char*) const'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::locale::locale[in-charge](std::locale const&)'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::__num_base::_S_format_int(std::ios_base 
const&, char*, char, char)'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::ctype<char>::do_tolower(char*, char const*) 
const'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::locale::locale[in-charge]()'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::ctype<char>::do_scan_not(unsigned short, 
char const*, char const*) const'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::__timepunct<char>::_S_timezones'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::ctype<char>::ctype[not-in-charge](unsigned 
short const*, bool, unsigned)'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::locale::operator==(std::locale const&) const'
/products/gcc-3.1.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/../../../libstdc++.so: 
undefined reference to `std::ctype<char>::do_scan_is(unsigned short, 
char const*, char const*) const'
(Continue reading)

Rupert Wood | 1 Nov 11:55 2002
Picon

RE: File processing errors during compilation

Learn GCC wrote:

> Sun Solaris 5.8
:
> ld: fatal: file values-Xa.o: cannot open file: No such file or
> directory

Install package SUNWarc from your Solaris media. If you want to build
64-bit applications then you'll need SUNWarcx too.

Rup.

Colin Law | 1 Nov 13:19 2002
Picon
Picon

static map in a base class?

Hi,

Could somebody explain why the code below will compile, but causes a seg 
fault when run. It appears the the map is not initialized with the base 
class when creating a derived class from it... is this correct? Should 
the map be getting initialized with the base class or am I missing 
something here?

Suggestions anyone?

Regards,
~Colin.

//A.h
#ifndef __A_H__
#define __A_H__
#include <map>

class A
{
public:
  A() ;
  ~A() ;
  void doSomething() ;
  static std::map<int,std::string> theMap ;
};
#endif
-------------------------------------------------------
//B.h
#ifndef __B_H__
(Continue reading)

Eljay Love-Jensen | 1 Nov 14:21 2002
Picon

Re: static map in a base class?

Hi Colin,

A's static theMap will be initialized by the time main is called.

B's static testB will be initialized by the time main is called.  But note, 
it DEPENDS on A's static theMap being initialized BEFORE it gets 
initialized, and MAY BE initialized BEFORE A's static theMap is 
initialized!  There is NO guarantee of order-of-initialization between 
different compile modules.

One way to alleviate the cross-module initialization conundrum is via:
// In a.cpp
class A
{
public:
A() ;
~A() ;
void doSomething() ;
static std::map<int,std::string>& getMap();
};

// In a.h
std::map<int,std::string>& A::getMap() {
static std::map<int,std::string> A::theMap ;
return theMap;
}

The trick works because getMap's static theMap is GUARANTEED to be 
initialized the first time the routine is accessed.  Regardless of 
cross-module order-of-initialization dependencies.
(Continue reading)

Colin Law | 1 Nov 15:17 2002
Picon
Picon

Re: static map in a base class?

Eljay Love-Jensen wrote:

> I may have had some typos in my pseudo-C++-code.  Nothing to hard to 
> touch up.
>
> :-)
>
> --Eljay
>
Eljay,

Thanks for the help, this has been bugging me for a while now.

~Colin.

Francis Hwang | 1 Nov 18:59 2002

Re: Problem compiling GCC 3.2 on i686-pc-linux: "not enough room for program headers"

(I sent this yesterday, but it looked like it didn't go through, so I'm
sending again ...)

So updating binutils helped: I'm getting further, but now I'm stuck
somewhere else. It's on this line:

/home/francis/gcc-3.2/gcc/gcj -B/home/francis/gcc-3.2/i686-pc-linux-gnu/libj
ava/ -B/home/francis/gcc-3.2/gcc/ --encoding=UTF-8 -fclasspath= -fbootclassp
ath=/home/francis/gcc-3.2/i686-pc-linux-gnu/libjava -ffloat-store -g -O2 -MD
 -MT java/lang/Class.lo -MF java/lang/Class.d -c
java/lang/Class.java -fPIC -o java/lang/.libs/Class.o
/tmp/ccWKhZuc.s: Assembler messages:
/tmp/ccWKhZuc.s:2: Warning: Missing string
/tmp/ccWKhZuc.s:2: Error: Rest of line ignored. First ignored character is
`1'.
/tmp/ccWKhZuc.s:17: Error: Unknown pseudo-op:  `.loc'
/tmp/ccWKhZuc.s:28: Error: Unknown pseudo-op:  `.loc'
/tmp/ccWKhZuc.s:34: Error: Unknown pseudo-op:  `.loc'
/tmp/ccWKhZuc.s:43: Warning: Missing string
/tmp/ccWKhZuc.s:43: Error: Rest of line ignored. First ignored character is
`2'.
/tmp/ccWKhZuc.s:44: Warning: Missing string
/tmp/ccWKhZuc.s:44: Error: Rest of line ignored. First ignored character is
`3'.
....

I'll spare you the 6 or so screens of output: It's a lot of "Unknown
pseudo-op" and "Bad .section directive: want a,w,x in string" ... Since this
is Java-specific stuff, and I only really care about C & C++ at this point,
I tried using
(Continue reading)

Satya | 2 Nov 02:29 2002

Thread safety of gcc when using -ax option


Hi,
  I am using gcc -ax option to obtain the sequence of basic blocks
executed. I want to whether this is multi-thread safe.

Thanks,
Satya

Nikhil Bansal | 2 Nov 02:35 2002
Picon

Help in MIPS cross compiler

Hi

I have a cross compiler for MIPS installed. It generates assembly files
and even object file also. But when I use linker to generate executale
files, it gives some errors. I think I need to include some libraries to
generate binaries. Could Someone tell me, where to get those files and how
to use them.

Thanks
Nikhil

tendim | 2 Nov 09:04 2002
Picon

pthreads man pages, where?

Hi.

I've installed gcc-3.2 on my system, and I was under the impression that
since I gave the --enable-threads=posix switch to configure, it would also
install the man pages for the various posix thread functions.  I.e.,
pthread_create, etc.

However, when I issue "man pthread_create" or something similar, my system
can't find the man pages!  :(

are they not installed by default with gcc-3.2?  I know they exist, as the
computers at my school (albeit with gcc-3.1) have them.

If they are not installed by default, where can I get them?

Thanks,
Patrick

patrick <at> tendim.cjb.net
"It's simple, overspecialize and you breed in weakness."
 --Ghost in the Shell

Sebastian Huber | 2 Nov 10:52 2002
Picon

Re: pthreads man pages, where?

On Saturday 02 November 2002 09:04, tendim wrote:
> Hi.
>
> I've installed gcc-3.2 on my system, and I was under the impression that
> since I gave the --enable-threads=posix switch to configure, it would also
> install the man pages for the various posix thread functions.  I.e.,
> pthread_create, etc.
>
> However, when I issue "man pthread_create" or something similar, my system
> can't find the man pages!  :(
> [...]

Hello,
you can try 'info libc' and then choose the 'POSIX Threads' section.


Gmane