Re: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
Brought to you by:
complement
|
From: Gubenko, B. <bor...@hp...> - 2008-11-14 00:27:00
|
Gubenko, Boris wrote:
> If you can provide a small stand-alone reproducer, I'll take a look.
No reproducer needed, I understand the problem.
On HP-UX, <cstdlib> and <cwchar> include errno.h:
bash-2.03$ find /opt/aCC/include_std/ -exec \
> egrep -l "[[:space:]]*#[[:space:]]*include[[:space:]]*<.*errno.h>" {} \;
/opt/aCC/include_std/cerrno
/opt/aCC/include_std/cstdlib
/opt/aCC/include_std/cwchar
bash-2.03$
This is what's triggering #error directive in STLport' errno.h jacket for
a program like x.cpp below, including <errno.h> after either <cstdlib> or
<cwchar> :
x.cpp
-----
#include <cstdlib>
#include <errno.h>
bash-2.03$ x.sh
+ export STLPORT_ROOT=/home/borisg/STLport-5.1.7/STLport-5.1.7
+ aCC -c -Aa -mt -I /home/borisg/STLport-5.1.7/STLport-5.1.7/stlport x.cpp
"/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/errno.h", line 46: error #2035:
#error directive: errno has been defined before inclusion of errno.h
header.
# error errno has been defined before inclusion of errno.h header.
^
1 error detected in the compilation of "x.cpp".
bash-2.03$
A workaround is to make sure that <errno.h> is included first. Another workaround
is including <cerrno> instead of <errno.h>. The STLport <cerrno> jacket does not
have the check that <errno.h> jacket has and since <errno.h> does not declare
any functions, just macros, it makes no difference which flavour of header to include.
HTH,
Boris
________________________________
From: Gubenko, Boris
Sent: Thursday, November 13, 2008 2:29 PM
To: Meir Yanovich; stl...@li...
Subject: Re: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
Meir,
I downloaded STLport 5.1.7 and could not reproduce your compilation
problem with x.cpp below:
x.cpp
-----
#include <errno.h>
bash-2.03$ aCC -V
aCC: HP C/aC++ B3910B A.06.17 [Mar 4 2008]
bash-2.03$ uname -a
HP-UX B.11.31 U ia64
bash-2.03$ export STLPORT_ROOT=$HOME/STLport-5.1.7/STLport-5.1.7
bash-2.03$ aCC -c -Aa -mt -I $STLPORT_ROOT/stlport x.cpp
bash-2.03$
And, as you can see from the include file hierarchy below, STLport jacket
stlport/errno.h is included before native header /include_std/errno.h, as
expected:
bash-2.03$ aCC -c -Aa -mt -I $STLPORT_ROOT/stlport x.cpp -H
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/errno.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/_prolog.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/features.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/_stlport_version.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/user_config.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/compat.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/host.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/_system.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/_hpux.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/_hpacc.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/stl_confix.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/_native_headers.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/_prolog.h
/opt/aCC/include_std/../include_std/errno.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/cerrno
/opt/aCC/include_std/../include_std/cerrno
/usr/include/errno.h
/usr/include/sys/stdsyms.h
/usr/include/sys/errno.h
/usr/include/sys/stdsyms.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/_epilog.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/config/_epilog.h
/home/borisg/STLport-5.1.7/STLport-5.1.7/stlport/stl/_config_compat_post.h
bash-2.03$
If you can provide a small stand-alone reproducer, I'll take a look.
Boris
________________________________
From: Meir Yanovich [mailto:me...@ft...]
Sent: Thursday, November 13, 2008 9:58 AM
To: Gubenko, Boris; stl...@li...
Subject: RE: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
Thanks for the reply , i will try to use the "brute force method"
but how can i do it without breaking the STLport including in the application
________________________________
From: Gubenko, Boris [mailto:bor...@hp...]
Sent: Thursday, November 13, 2008 4:55 PM
To: Meir Yanovich; stl...@li...
Subject: RE: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
Hi Meir,
it looks like the "native" errno.h header gets included before STLport "jacket": /STLport-5.1.7/stlport/errno.h. I don't know why. You might want to look at preprocessed file to see the order of inclusions. A brute force method would be to disable this check in the jacket.
Sorry I cannot help more.
Boris
From: Meir Yanovich [mailto:me...@ft...]
Sent: Thursday, November 13, 2008 3:02 AM
To: Gubenko, Boris; stl...@li...
Subject: RE: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
Thanks boris for the fast reply , now im getting new error
when compiling my executable :
/STLport-5.1.7/stlport/errno.h", line 46: error #2035: #error directive: errno has been defined
before inclusion of errno.h header.
is there any special flags i need to define when compiling STLport so it will include the errno.h?
or what ?
________________________________
From: Gubenko, Boris [mailto:bor...@hp...]
Sent: Wednesday, November 12, 2008 7:43 PM
To: Meir Yanovich; stl...@li...
Subject: RE: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
/include_std is a standard location of header files on HP-UX, "known" to the compiler. "+nostl" prevents the compiler from looking into this directory. Try to compile without "+nostl", but specify it on the link command.
This is what used to work with STLport 5.1 :
export STLPORT_ROOT=...../STLport.5_1/STLport.5_1/STLport
aCC -c -Aa -mt -I $STLPORT_ROOT/stlport x.cpp
aCC x.o -o x.out -mt +nostl -L $STLPORT_ROOT/build/lib/obj/aCC/so/ -lstlport
HTH,
Boris
________________________________
From: Meir Yanovich [mailto:me...@ft...]
Sent: Wednesday, November 12, 2008 7:21 AM
To: stl...@li...
Subject: [Stlport-devel] problems compiling on HP-UX hprx02 B.11.31 U ia64
hello all
i need to switch the rw stl with STLport , and i have some problems
first in compilation THE $OSNAME is in upper case so you have to change it when you try to build from source .
second when i try to compile the application with STLport 5.1.7 im getting compilation errors that says for example :
STLport-5.1.7/stlport/limits.h", line 27: error #2005-D: could not open source file "../include
_std/limits.h"
#include _STLP_NATIVE_C_HEADER(limits.h)
but in the source tar i download there is no include_std dir . do i need to create one ?
in my make files i added in the compilation :
+nostl -I/../../Path_To_Stl/STLport/STLport-5.1.7/stlport -I/../../Path_To_Stl/STLport/STLport-5.1.7/stlp
ort/stl
and in the linking i added :
+nostl -L//../../Path_To_Stl/STLport/STLport-5.1.7/build/lib/obj/aCC/so_stlg/ -lstlportstlg
the stlport file name is libstlportstlg.a
Thanks for helping
|