You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Mohd Tariq <ta...@gmail.com> on 2006/12/12 17:49:42 UTC

Problems facing while using third party STL

Hi Senthil,

I am building a C++ Application with HP aCC 6.10 compiler. During build it
gave error about iterators "#2135" and  later we found that iterators are
not supported by HP aCC6.10.'s  STL.

So now I have been trying to use third party STL that we got from
http://incubator.apache.org/stdcxx/. I have build that library successfully.
I am using "+nostl" option to link it to 3rd party STL.

To check  we have written a small  cpp program  which prints "Hello". The
following are the compiler options that we gave to compile this file:

aCC -v +DD64 +W829,641 -D_RWSTD_USE_CONFIG -D_RWSTDDEBUG +z -mt
-Wc,-ansi_for_scope,on  +nostl -I/opt/aCC/include_std
-I/opt/aCC/include_std/iostream_compat  -I/home/stdcxx-4.1.3/include
-I/home/build1/nls -I/usr/include -I/usr -L/usr/lib/hpux64
-L/home/build1/lib -L/opt/langtools/lib/hpux64 -L/opt/aCC/lib/hpux64
-L/home/build1/rwtest -l:librwtest11D.a -l:libstd11D.so -l:
libstd11D.so.4.1.3 test.cpp

We are using +nostl option as mentioned in the acc programming guide which
would suppress all default -L and -I options. The options mentioned above in
bold are to include and link the third party libraries.

The sample program is:

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


We are getting errors during the linking stage. The errors are:

ld: Unsatisfied symbol "std::__rw_std_streams" in file test.o
ld: Unsatisfied symbol "std::ios_base::_C_unsafe_clear(int,int)" in file
test.o
ld: Unsatisfied symbol "_HPMutexWrapper::lock(void*)" in file test.o
ld: Unsatisfied symbol "virtual table of __rw::__rw_thread_error" in file
test.o
ld: Unsatisfied symbol "type info of __rw::__rw_thread_error" in file test.o
ld: Unsatisfied symbol "_HPMutexWrapper::unlock(void*)" in file test.o

And when i compiled a sample program which contails templates it gave the
same error as before.
Please anyone help me in this regard,
Thanks and Regards

Re: Problems facing while using third party STL

Posted by Travis Vitek <vi...@roguewave.com>.

It depends on the compiler you are using. If you are using The HP aC++
compiler, I believe that you should compile and link with the +nostl flag.

This should be covered in your compiler documentation, and could probably be
gleaned from the output generated when building the stdcxx tests and
examples.

Travis


Radha Manickam wrote:
> 
> Anyone tell me how to avoid the standard c++ library dependency during the
> linking?
> 

-- 
View this message in context: http://old.nabble.com/Problems-facing-while-using-third-party-STL-tp15101795p31784725.html
Sent from the stdcxx-user mailing list archive at Nabble.com.


Re: Problems facing while using third party STL

Posted by Radha Manickam <ra...@gmail.com>.
Hi,

Anyone tell me how to avoid the standard c++ library dependency during the
linking?

I am using HPUX V2 IA64.

Thanks,
Radha.
-- 
View this message in context: http://old.nabble.com/Problems-facing-while-using-third-party-STL-tp15101795p31783152.html
Sent from the stdcxx-user mailing list archive at Nabble.com.


Re: Problems facing while using third party STL

Posted by Martin Sebor <se...@roguewave.com>.
Mohd Tariq wrote:

> Hi Senthil,
> 
> I am building a C++ Application with HP aCC 6.10 compiler. During build it
> gave error about iterators "#2135" and  later we found that iterators are
> not supported by HP aCC6.10.'s  STL.
> 
> So now I have been trying to use third party STL that we got from
> http://incubator.apache.org/stdcxx/. I have build that library 
> successfully.
> I am using "+nostl" option to link it to 3rd party STL.
> 
> To check  we have written a small  cpp program  which prints "Hello". The
> following are the compiler options that we gave to compile this file:
> 
> aCC -v +DD64 +W829,641 -D_RWSTD_USE_CONFIG -D_RWSTDDEBUG +z -mt
> -Wc,-ansi_for_scope,on

I don't think you need the ansi_for_scope option, it's on
by default.

   +nostl -I/opt/aCC/include_std
> -I/opt/aCC/include_std/iostream_compat  -I/home/stdcxx-4.1.3/include
> -I/home/build1/nls -I/usr/include -I/usr -L/usr/lib/hpux64
> -L/home/build1/lib -L/opt/langtools/lib/hpux64 -L/opt/aCC/lib/hpux64
> -L/home/build1/rwtest -l:librwtest11D.a -l:libstd11D.so -l:

You don't need to link with librwtest unless you're building
the stdcxx test suite. Also, you shouln't be linking with the
versioned library below. Use the link instead.

> libstd11D.so.4.1.3 test.cpp

You're compiling and linking in the same step (which is okay).
When compiling and linking in two steps, dependent libraries
must be listed after the object file on the link line. I
suspect the same is going to be true when doing both in one
step.

> 
> We are using +nostl option as mentioned in the acc programming guide which
> would suppress all default -L and -I options. The options mentioned 
> above in
> bold are to include and link the third party libraries.
> 
> The sample program is:
> 
> #include<iostream>
> using namespace std;
> int main(){
>    cout<<"Hello";
>    return 0;
> }
> 
> 
> We are getting errors during the linking stage. The errors are:
> 
> ld: Unsatisfied symbol "std::__rw_std_streams" in file test.o
> ld: Unsatisfied symbol "std::ios_base::_C_unsafe_clear(int,int)" in file
> test.o
> ld: Unsatisfied symbol "_HPMutexWrapper::lock(void*)" in file test.o

This suggests that you have a dependency on the HP C++ Standard
Library. That would be bad (you can't mix two implementations
of the same library in the same program).

Martin


> ld: Unsatisfied symbol "virtual table of __rw::__rw_thread_error" in file
> test.o
> ld: Unsatisfied symbol "type info of __rw::__rw_thread_error" in file 
> test.o
> ld: Unsatisfied symbol "_HPMutexWrapper::unlock(void*)" in file test.o
> 
> And when i compiled a sample program which contails templates it gave the
> same error as before.
> Please anyone help me in this regard,
> Thanks and Regards
> 


Re: Problems facing while using third party STL

Posted by Martin Sebor <se...@roguewave.com>.
Mohd Tariq wrote:

> Hi Senthil,
> 
> I am building a C++ Application with HP aCC 6.10 compiler. During build it
> gave error about iterators "#2135" and  later we found that iterators are
> not supported by HP aCC6.10.'s  STL.
> 
> So now I have been trying to use third party STL that we got from
> http://incubator.apache.org/stdcxx/. I have build that library 
> successfully.
> I am using "+nostl" option to link it to 3rd party STL.
> 
> To check  we have written a small  cpp program  which prints "Hello". The
> following are the compiler options that we gave to compile this file:
> 
> aCC -v +DD64 +W829,641 -D_RWSTD_USE_CONFIG -D_RWSTDDEBUG +z -mt
> -Wc,-ansi_for_scope,on

I don't think you need the ansi_for_scope option, it's on
by default.

   +nostl -I/opt/aCC/include_std
> -I/opt/aCC/include_std/iostream_compat  -I/home/stdcxx-4.1.3/include
> -I/home/build1/nls -I/usr/include -I/usr -L/usr/lib/hpux64
> -L/home/build1/lib -L/opt/langtools/lib/hpux64 -L/opt/aCC/lib/hpux64
> -L/home/build1/rwtest -l:librwtest11D.a -l:libstd11D.so -l:

You don't need to link with librwtest unless you're building
the stdcxx test suite. Also, you shouln't be linking with the
versioned library below. Use the link instead.

> libstd11D.so.4.1.3 test.cpp

You're compiling and linking in the same step (which is okay).
When compiling and linking in two steps, dependent libraries
must be listed after the object file on the link line. I
suspect the same is going to be true when doing both in one
step.

> 
> We are using +nostl option as mentioned in the acc programming guide which
> would suppress all default -L and -I options. The options mentioned 
> above in
> bold are to include and link the third party libraries.
> 
> The sample program is:
> 
> #include<iostream>
> using namespace std;
> int main(){
>    cout<<"Hello";
>    return 0;
> }
> 
> 
> We are getting errors during the linking stage. The errors are:
> 
> ld: Unsatisfied symbol "std::__rw_std_streams" in file test.o
> ld: Unsatisfied symbol "std::ios_base::_C_unsafe_clear(int,int)" in file
> test.o
> ld: Unsatisfied symbol "_HPMutexWrapper::lock(void*)" in file test.o

This suggests that you have a dependency on the HP C++ Standard
Library. That would be bad (you can't mix two implementations
of the same library in the same program).

Martin


> ld: Unsatisfied symbol "virtual table of __rw::__rw_thread_error" in file
> test.o
> ld: Unsatisfied symbol "type info of __rw::__rw_thread_error" in file 
> test.o
> ld: Unsatisfied symbol "_HPMutexWrapper::unlock(void*)" in file test.o
> 
> And when i compiled a sample program which contails templates it gave the
> same error as before.
> Please anyone help me in this regard,
> Thanks and Regards
>