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