public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Solaris and std::wstring - Help!
@ 2003-12-03 12:51 Kyrre Kristiansen
  2003-12-03 13:53 ` Eljay Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Kyrre Kristiansen @ 2003-12-03 12:51 UTC (permalink / raw)
  To: gcc-help

Hello.

I've been trying to compile some C++ code for Solaris
for a while now, and are having quite a lot of
problems with code that uses wstring.

1. Firstly, I've tried to just compile it, and I get
Source/WStringAttributeType.h:50: error: no type
`wstring' in `std' from the compiler.
2. I tried to create my own .h- file, that contained
the following:

#include <string>

namespace std
{
    typedef std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
std::wstring;
}

This compiled fine, also with my code. But, upon
linking, it comes up with unresolved symbols: 

libc.so.1 =>     /usr/lib/libc.so.1
        libstdc++.so.5 =>       
/usr/local/lib/libstdc++.so.5
        libgcc_s.so.1 =>        
/usr/local/lib/libgcc_s.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
       
/usr/platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1
        symbol not found:
_ZNSt11char_traitsIwE6lengthEPKw             
(./libNVDBModell.so)
        symbol not found:
_ZNSt11char_traitsIwE7compareEPKwS2_j        
(./libNVDBModell.so)
        symbol not found:
_ZNSt11char_traitsIwE4copyEPwPKwj            
(./libNVDBModell.so)
        symbol not found:
_ZNSt11char_traitsIwE4moveEPwPKwj            
(./libNVDBModell.so)

Anyone konw how I can get my code successfully
compiled and linked with gcc?
from gcc -v:
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/specs
Configured with: ../configure
--with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld
--disable-nls
Thread model: posix
gcc version 3.3.2


It is very important that I can compile with wstring,
as a lot of important code is using it! 

With regards,
Kyrre.

=====
------------------------------------------------------------
Kyrre Kristiansen

________________________________________________________________________
Download Yahoo! Messenger now for a chance to win Live At Knebworth DVDs
http://www.yahoo.co.uk/robbiewilliams

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Solaris and std::wstring - Help!
  2003-12-03 12:51 Solaris and std::wstring - Help! Kyrre Kristiansen
@ 2003-12-03 13:53 ` Eljay Love-Jensen
  0 siblings, 0 replies; 3+ messages in thread
From: Eljay Love-Jensen @ 2003-12-03 13:53 UTC (permalink / raw)
  To: kyrre_kristiansen, gcc-help

Hi Kyrre,

Solaris does not support C99 wide string manipulation.

Building GCC itself detects that lack of support, and disables wide string support.

Note:  Solaris does support C++98 wide string manipulation, but the GCC test looks for C99 compliance, which has a few additional functions.

The problem is in detection for (and the missing of) vfwscanf, vswscanf, vwscanf, wcstof and (perhaps) iswblank.

qv...
<http://www.cygwin.com/ml/cygwin/2002-11/msg00920.html>
<http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg43724.html>
<http://www.geocrawler.com/archives/3/356/2001/11/1050/6963066/>
<http://gcc.gnu.org/ml/libstdc++/2003-09/txt00002.txt>
<http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01830.html>

Assuming that this hasn't been fixed in the GCC head, I believe you need to doctor up the acinclude.m4 file and rebuild GCC to get C++ std::wstring support in GCC on Solaris.

HTH,
--Eljay 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Solaris and std::wstring - Help!
@ 2003-12-03 16:38 Assinovsky, Lev
  0 siblings, 0 replies; 3+ messages in thread
From: Assinovsky, Lev @ 2003-12-03 16:38 UTC (permalink / raw)
  To: kyrre_kristiansen, gcc-help

[-- Attachment #1: Type: text/plain, Size: 4217 bytes --]

I personally hacked just gcc 3.2.
Not sure it will work with gcc 3.3.x family.

0. Copy gcc-3.2.tar.gz distribution to any directory. 
   Let's  name this directory as "<dist>.

1. Become user "root" and choose a directory where you are going to unpack gcc distribution.
   Let's call it <gcc-prefix>. 
   Then:
   cd <gcc-prefix>

2. Unpack distribution gcc-3.2.tar.gz using command "gtar -zxf <dist>/gcc-3.2.tar.gz"   (automatically creates top directory gcc-3.2 in <gcc-prefix>)
3. Follow the steps bellow (to fix wchar support problem):
   3.1. In directory <gcc-prefix>/gcc-3.2/libstdc++-v3:
     remove all occurrences of the words:
        "vfwscanf", "vswscanf", "vwscanf", "wcstof"
     from the following files:
       acinclude.m4 (1 spot)
       aclocal.m4 (1 spot)
       configure (6 spots)

   3.2 In the directory <gcc-prefix>/gcc-3.2/libstdc++-v3/include/c_std/:
        file std_cwctype.h: 
          remove string "using ::iswblank;" 
        file std_cwchar.h:
          remove the following strings:
             "using ::vfwscanf;"
             "using ::vswscanf;"
             "using ::vwscanf;"
             "using ::wcstof;"

4. Continue the standard way
   4.1  Choose a directory where you are going to create build directory. 
        Let's call it <build-prefix>. Go there:
        cd <build-prefix>

   4.2. create build directory (e.g. gcc-3.2-build), create installation directory (e.g. /opt/gcc)
   4.3 cd gcc-3.2-build
   2.4 <gcc-prefix>/gcc-3.2/configure --prefix=/opt/gcc  --enable-threads=posix --enable-languages=c,c++
   2.5 make bootstrap. It takes a while.
   2.6 make install
    
Hope it'll help.
----
Lev Assinovsky
Aelita Software Corporation
O&S InTrust Framework Division, Team Leader
ICQ# 165072909


> -----Original Message-----
> From: Kyrre Kristiansen [mailto:kyrre_kristiansen@yahoo.co.uk]
> Sent: Wednesday, December 03, 2003 3:51 PM
> To: gcc-help@gcc.gnu.org
> Subject: Solaris and std::wstring - Help!
> 
> 
> Hello.
> 
> I've been trying to compile some C++ code for Solaris
> for a while now, and are having quite a lot of
> problems with code that uses wstring.
> 
> 1. Firstly, I've tried to just compile it, and I get
> Source/WStringAttributeType.h:50: error: no type
> `wstring' in `std' from the compiler.
> 2. I tried to create my own .h- file, that contained
> the following:
> 
> #include <string>
> 
> namespace std
> {
>     typedef std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> >
> std::wstring;
> }
> 
> This compiled fine, also with my code. But, upon
> linking, it comes up with unresolved symbols: 
> 
> libc.so.1 =>     /usr/lib/libc.so.1
>         libstdc++.so.5 =>       
> /usr/local/lib/libstdc++.so.5
>         libgcc_s.so.1 =>        
> /usr/local/lib/libgcc_s.so.1
>         libdl.so.1 =>    /usr/lib/libdl.so.1
>         libm.so.1 =>     /usr/lib/libm.so.1
>        
> /usr/platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1
>         symbol not found:
> _ZNSt11char_traitsIwE6lengthEPKw             
> (./libNVDBModell.so)
>         symbol not found:
> _ZNSt11char_traitsIwE7compareEPKwS2_j        
> (./libNVDBModell.so)
>         symbol not found:
> _ZNSt11char_traitsIwE4copyEPwPKwj            
> (./libNVDBModell.so)
>         symbol not found:
> _ZNSt11char_traitsIwE4moveEPwPKwj            
> (./libNVDBModell.so)
> 
> Anyone konw how I can get my code successfully
> compiled and linked with gcc?
> from gcc -v:
> Reading specs from
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/specs
> Configured with: ../configure
> --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld
> --disable-nls
> Thread model: posix
> gcc version 3.3.2
> 
> 
> It is very important that I can compile with wstring,
> as a lot of important code is using it! 
> 
> With regards,
> Kyrre.
> 
> =====
> ------------------------------------------------------------
> Kyrre Kristiansen
> 
> ______________________________________________________________
> __________
> Download Yahoo! Messenger now for a chance to win Live At 
> Knebworth DVDs
> http://www.yahoo.co.uk/robbiewilliams
> 

[-- Attachment #2: gcc_hack_wide.sh --]
[-- Type: application/octet-stream, Size: 952 bytes --]

#!/bin/bash

F1=acinclude.m4
F2=aclocal.m4
F3=configure

F4=std_cwctype.h
F5=std_cwchar.h




W1=vfwscanf
W2=vswscanf
W3=vwscanf
W4=wcstof
W5=iswblank

notexist()
{
  test -f "$1"
  if [ "$?" != 0 ]; then 
    echo "File $1 doesn't exist"
    return 0
  fi

  return 2  
}
  
        

# 1 - file 
change1 ()
{
  cp -f $1.ORIG $1
  cat $1 | sed -e "s/$W1//g" -e "s/$W2//g" -e "s/$W3//g" -e "s/$W4//g" > $1.SAV
  cp $1.SAV $1
}


# 1 - file 
change2 ()
{
  cp -f $1.ORIG $1
  cat $1 | sed -e "s/using ::$W5;//g" > $1.SAV
  cp $1.SAV $1
}


# 1 - file 
change3 ()
{
  cp -f $1.ORIG $1
  cat $1 | sed -e "s/using ::$W1;//g" -e "s/using ::$W2;//g" -e "s/using ::$W3;//g" -e "s/using ::$W4;//g" > $1.SAV
  cp $1.SAV $1
}




# main

cd libstdc++-v3

if notexist $F1 || notexist $F2 || notexist $F3 ; then
    exit 2
fi

change1 $F1
change1 $F2
change1 $F3


cd include/c_std

if notexist $F4 || notexist $F5 ; then
    exit 2
fi

change2 $F4
change3 $F5




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-03 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-03 12:51 Solaris and std::wstring - Help! Kyrre Kristiansen
2003-12-03 13:53 ` Eljay Love-Jensen
2003-12-03 16:38 Assinovsky, Lev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).