Compiling (Porting) Xalan-C for QNX 6.1 (std errors)

Hello-
Since this is the porting group I’ll try here. Even if you haven’t tried
to port Xalan perhaps you’ve seem similar type compile errors in the
std area before.
Here is a paste of my issue:
Thanks in advance.
If you want me to email you a couple source files that, let me know.

I’m using gcc 2.95.2,
This is UGLY!

g++ -O -DNDEBUG -fpic -Wall -fno-honor-std -DX86_PC_NTO_QNX -D_REENTRANT -c
-I. -I/opt/xe/src/ -I/opt/xe/include/xercesc -I/opt/xe/include/ -o
/opt/x/c/obj/NodeSorter.o XSLT/NodeSorter.cpp

/usr/include/memory: In method
`_Temp_iteratorNodeSorter::VectorEntry::_Temp_iterator(int = 0)’:

/usr/include/algorithm:1817: instantiated
from`_Stable_sort<_Ptrit<NodeSorter::VectorEntry,int,NodeSorter::VectorEntry
*,NodeSorter::VectorEntry&,NodeSorter::VectorEntry ,NodeSorter::VectorEntry
&>, ptrdiff_t,
NodeSorter::VectorEntry,NodeSorter::NodeSortKeyCompare>(_Ptrit<NodeSorter::V
ectorEntry,int,NodeSorter::VectorEntry
,NodeSorter::VectorEntry
&,NodeSorter::VectorEntry ,NodeSorter::VectorEntry
&>,_Ptrit<NodeSorter::VectorEntry,int,NodeSorter::VectorEntry
,NodeSorter::VectorEntry&,NodeSorter::VectorEntry ,NodeSorter::VectorEntry
&>, ptrdiff_t *, NodeSorter::VectorEntry *,NodeSorter::NodeSortKeyCompare)’

/usr/include/algorithm:1826: instantiated from
`stable_sort<_Ptrit<NodeSorter::VectorEntry,int,NodeSorter::VectorEntry
*,NodeSorter::VectorEntry&,NodeSorter::VectorEntry *,NodeSorter::VectorEntry
&>,NodeSorter::NodeSortKeyCompare>(_Ptrit<NodeSorter::VectorEntry,int,NodeSo
rter::VectorEntry ,NodeSorter::VectorEntry&,NodeSorter::VectorEntry
,NodeSorter::VectorEntry &>,
_Ptrit<NodeSorter::VectorEntry,int,NodeSorter::VectorEntry
,NodeSorter::Vect
orEntry &,NodeSorter::VectorEntry *,NodeSorter::VectorEntry
&>,NodeSorter::NodeSortKeyCompare)’

XSLT/NodeSorter.cpp:124: instantiated from here

/usr/include/memory:246: get_temporary_buffer' undeclared in namespace std’

/usr/include/memory:246: confused by earlier errors, bailing out

make: *** [/opt/x/c/obj/NodeSorter.o] Error 1

Hi Kevin

Kevin Caporaso <kcaporaso@pillardata.com> wrote:

| XSLT/NodeSorter.cpp:124: instantiated from here

| /usr/include/memory:246: get_temporary_buffer' undeclared in namespace | std’

These are the only relevent lines. All I can make out is that, xerces
uses GNU C++ specific constructs, so you might try 6.2 NC , which ships
with GNU C++ libs. Also check NodeSorter.cpp:124 and see if you can
track where the error is originating.

HTH

Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

Mritunjai-
Thanks for the response:
Does 6.2 NC mean version 6.2 Non-Commercial of QNX? If so then that is not
an option,
I’m developing for a commercial application. I’ve visited the WWW and
qnx.wox.org
repositories and have installed all the available c++ libraries I can find.

As to the rest of your idea…
I have pasted the actual function making the call to stable_sort() which is
where the mess begins because stable_sort calls get_temporary_buffer.
Note in this function that XALAN_NO_NAMESPACES is not defined.

void
NodeSorter::sort(StylesheetExecutionContext& executionContext)
{
assert(m_scratchVector.size() > 0);

// Make sure the caches are cleared when we’re done…
CollectionClearGuard
guard1(m_numberResultsCache);
CollectionClearGuard
guard2(m_stringResultsCache);

NodeSortKeyCompare theComparer(
executionContext,
*this,
m_scratchVector,
m_keys);

#if !defined(XALAN_NO_NAMESPACES)
using namespace std;
using std::stable_sort;
#endif

// Use the stl sort algorithm, which will use our compare functor,
// which returns true if first less than second
stable_sort(
m_scratchVector.begin(),
m_scratchVector.end(),
theComparer);
[!! This is the source of the error !!!]
}

I find the most confusing part about the error to be that
‘get_temporary_buffer’
is not declared within the std namespace. Doesn’t that seem weird? After
all, it’s in the
header file, isn’t that considered part of the std namespace hence
_STD_BEGIN?

TIA,
$Kevin



“Mritunjai” <mritun@solitaire.hostel4.iitb.ac.in> wrote in message
news:aeqb7d$8jp$1@inn.qnx.com

Hi Kevin

Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
snip

| XSLT/NodeSorter.cpp:124: instantiated from here

| /usr/include/memory:246: get_temporary_buffer' undeclared in namespace | std’

These are the only relevent lines. All I can make out is that, xerces
uses GNU C++ specific constructs, so you might try 6.2 NC , which ships
with GNU C++ libs. Also check NodeSorter.cpp:124 and see if you can
track where the error is originating.

HTH

Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

Kevin Caporaso <kcaporaso@pillardata.com> wrote:

Mritunjai-
Thanks for the response:
Does 6.2 NC mean version 6.2 Non-Commercial of QNX? If so then that is not
an option,
I’m developing for a commercial application. I’ve visited the WWW and

I don’t see why “commercial application” is a problem.
“Xalan-C” is a open source project (I assume) and you can do the
porting on the 6.2NC and create a “Xalan-C” package. You can
make this package freely available, which should satisfy the NC requirement.

You can then install this package onto your 6.1 box and do your
own commercial application development.

Frank

qnx.wox.org
repositories and have installed all the available c++ libraries I can find.

As to the rest of your idea…
I have pasted the actual function making the call to stable_sort() which is
where the mess begins because stable_sort calls get_temporary_buffer.
Note in this function that XALAN_NO_NAMESPACES is not defined.

void
NodeSorter::sort(StylesheetExecutionContext& executionContext)
{
assert(m_scratchVector.size() > 0);

// Make sure the caches are cleared when we’re done…
CollectionClearGuard<NumberResultsCacheType
guard1(m_numberResultsCache);
CollectionClearGuard<StringResultsCacheType
guard2(m_stringResultsCache);

NodeSortKeyCompare theComparer(
executionContext,
*this,
m_scratchVector,
m_keys);

#if !defined(XALAN_NO_NAMESPACES)
using namespace std;
using std::stable_sort;
#endif

// Use the stl sort algorithm, which will use our compare functor,
// which returns true if first less than second
stable_sort(
m_scratchVector.begin(),
m_scratchVector.end(),
theComparer);
[!! This is the source of the error !!!]
}

I find the most confusing part about the error to be that
‘get_temporary_buffer’
is not declared within the std namespace. Doesn’t that seem weird? After
all, it’s in the
memory> header file, isn’t that considered part of the std namespace hence
_STD_BEGIN?

TIA,
$Kevin



“Mritunjai” <> mritun@solitaire.hostel4.iitb.ac.in> > wrote in message
news:aeqb7d$8jp$> 1@inn.qnx.com> …
Hi Kevin

Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
snip

| XSLT/NodeSorter.cpp:124: instantiated from here

| /usr/include/memory:246: get_temporary_buffer' undeclared in namespace | std’

These are the only relevent lines. All I can make out is that, xerces
uses GNU C++ specific constructs, so you might try 6.2 NC , which ships
with GNU C++ libs. Also check NodeSorter.cpp:124 and see if you can
track where the error is originating.

HTH

Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

Hi Kevin

Kevin Caporaso <kcaporaso@pillardata.com> wrote:
| Does 6.2 NC mean version 6.2 Non-Commercial of QNX? If so then that is not
| an option,
| I’m developing for a commercial application. I’ve visited the WWW and
| qnx.wox.org
| repositories and have installed all the available c++ libraries I can find.

If you’ve 6.2 SE/PE then gnu c++ libs are already bundled. GNU C++ is
poor (QNX) man’s C++. as of 6.2, NC doesn’t have dinkum c++ libs.



Anyway, regarding your problem, this is getting interesting. Something
fishy is going on… may be namespace corruption by Xalan headers.

I tried a program using all flavours of sort including stable_sort()
from Bruce Eckel’s TIC++ (viz. SortTest.cpp from chapter 5 of Vol 2).
Compiles and runs flawlessly. I even tried removing global “using
namespace std;” and just using std::stable_sort… works!

Try

| std::stable_sort(
| m_scratchVector.begin(),
| m_scratchVector.end(),
| theComparer);

and look around for line that includes and . They
might provide a clue why things are going wrong. One more thing…
remove -fpic and -fhonor-std/-fno-honor-std and just use qcc

CC=qcc CXX=qcc ./configure --flags-that-you-need

| I find the most confusing part about the error to be that
| ‘get_temporary_buffer’
| is not declared within the std namespace. Doesn’t that seem weird? After
| all, it’s in the
| header file, isn’t that considered part of the std namespace hence
| _STD_BEGIN?

Yep. That’s how its intended to be… however I can’t really say what’s
going on until I see xalan sources.


Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

Frank,
How about I just get those GNU C++ Libraries that Mritunjai has mentioned?
Where would you recommend I get those… or what file can I look for to
determine
if I already have them on my system?
Also… what version of the gcc compiler is on 6.2NC ?

TIA,
$Kevin


“Frank Liu” <liug@mama.indstate.edu> wrote in message
news:aeqevc$baf$1@inn.qnx.com

Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
Mritunjai-
Thanks for the response:
Does 6.2 NC mean version 6.2 Non-Commercial of QNX? If so then that is
not
an option,
I’m developing for a commercial application. I’ve visited the WWW and

I don’t see why “commercial application” is a problem.
“Xalan-C” is a open source project (I assume) and you can do the
porting on the 6.2NC and create a “Xalan-C” package. You can
make this package freely available, which should satisfy the NC
requirement.

You can then install this package onto your 6.1 box and do your
own commercial application development.

Frank

qnx.wox.org
repositories and have installed all the available c++ libraries I can
find.

As to the rest of your idea…
I have pasted the actual function making the call to stable_sort() which
is
where the mess begins because stable_sort calls get_temporary_buffer.
Note in this function that XALAN_NO_NAMESPACES is not defined.

void
NodeSorter::sort(StylesheetExecutionContext& executionContext)
{
assert(m_scratchVector.size() > 0);

// Make sure the caches are cleared when we’re done…
CollectionClearGuard<NumberResultsCacheType
guard1(m_numberResultsCache);
CollectionClearGuard<StringResultsCacheType
guard2(m_stringResultsCache);

NodeSortKeyCompare theComparer(
executionContext,
*this,
m_scratchVector,
m_keys);

#if !defined(XALAN_NO_NAMESPACES)
using namespace std;
using std::stable_sort;
#endif

// Use the stl sort algorithm, which will use our compare
functor,
// which returns true if first less than second
stable_sort(
m_scratchVector.begin(),
m_scratchVector.end(),
theComparer);
[!! This is the source of the error !!!]
}

I find the most confusing part about the error to be that
‘get_temporary_buffer’
is not declared within the std namespace. Doesn’t that seem weird?
After
all, it’s in the
memory> header file, isn’t that considered part of the std namespace
hence
_STD_BEGIN?

TIA,
$Kevin



“Mritunjai” <> mritun@solitaire.hostel4.iitb.ac.in> > wrote in message
news:aeqb7d$8jp$> 1@inn.qnx.com> …
Hi Kevin

Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
snip

| XSLT/NodeSorter.cpp:124: instantiated from here

| /usr/include/memory:246: get_temporary_buffer' undeclared in namespace | std’

These are the only relevent lines. All I can make out is that, xerces
uses GNU C++ specific constructs, so you might try 6.2 NC , which ships
with GNU C++ libs. Also check NodeSorter.cpp:124 and see if you can
track where the error is originating.

HTH

Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

Kevin Caporaso <kcaporaso@pillardata.com> wrote:

Frank,
How about I just get those GNU C++ Libraries that Mritunjai has mentioned?

I believe the gnu c++ libraries are in the 6.1, but they are
just runtime libraries. You can’t do dev work (compile) without header files
and proper support in the compiler.
If you do the compile on the 6.2NC, and move the resulting stuff
onto 6.1, it will just run with the proper runtime…

Frank

Where would you recommend I get those… or what file can I look for to
determine
if I already have them on my system?
Also… what version of the gcc compiler is on 6.2NC ?

TIA,
$Kevin



“Frank Liu” <> liug@mama.indstate.edu> > wrote in message
news:aeqevc$baf$> 1@inn.qnx.com> …
Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
Mritunjai-
Thanks for the response:
Does 6.2 NC mean version 6.2 Non-Commercial of QNX? If so then that is
not
an option,
I’m developing for a commercial application. I’ve visited the WWW and

I don’t see why “commercial application” is a problem.
“Xalan-C” is a open source project (I assume) and you can do the
porting on the 6.2NC and create a “Xalan-C” package. You can
make this package freely available, which should satisfy the NC
requirement.

You can then install this package onto your 6.1 box and do your
own commercial application development.

Frank

qnx.wox.org
repositories and have installed all the available c++ libraries I can
find.

As to the rest of your idea…
I have pasted the actual function making the call to stable_sort() which
is
where the mess begins because stable_sort calls get_temporary_buffer.
Note in this function that XALAN_NO_NAMESPACES is not defined.

void
NodeSorter::sort(StylesheetExecutionContext& executionContext)
{
assert(m_scratchVector.size() > 0);

// Make sure the caches are cleared when we’re done…
CollectionClearGuard<NumberResultsCacheType
guard1(m_numberResultsCache);
CollectionClearGuard<StringResultsCacheType
guard2(m_stringResultsCache);

NodeSortKeyCompare theComparer(
executionContext,
*this,
m_scratchVector,
m_keys);

#if !defined(XALAN_NO_NAMESPACES)
using namespace std;
using std::stable_sort;
#endif

// Use the stl sort algorithm, which will use our compare
functor,
// which returns true if first less than second
stable_sort(
m_scratchVector.begin(),
m_scratchVector.end(),
theComparer);
[!! This is the source of the error !!!]
}

I find the most confusing part about the error to be that
‘get_temporary_buffer’
is not declared within the std namespace. Doesn’t that seem weird?
After
all, it’s in the
memory> header file, isn’t that considered part of the std namespace
hence
_STD_BEGIN?

TIA,
$Kevin



“Mritunjai” <> mritun@solitaire.hostel4.iitb.ac.in> > wrote in message
news:aeqb7d$8jp$> 1@inn.qnx.com> …
Hi Kevin

Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
snip

| XSLT/NodeSorter.cpp:124: instantiated from here

| /usr/include/memory:246: get_temporary_buffer' undeclared in namespace | std’

These are the only relevent lines. All I can make out is that, xerces
uses GNU C++ specific constructs, so you might try 6.2 NC , which ships
with GNU C++ libs. Also check NodeSorter.cpp:124 and see if you can
track where the error is originating.

HTH

Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

Frank Liu <liug@mama.indstate.edu> wrote:
| I believe the gnu c++ libraries are in the 6.1, but they are
| just runtime libraries. You can’t do dev work (compile) without header files
| and proper support in the compiler.
Right… there’s libcpp (dinkum) and libstd-c++ (gnu)

| If you do the compile on the 6.2NC, and move the resulting stuff
| onto 6.1, it will just run with the proper runtime…

Errr… may not! libc.so of 6.2 has extra stuff than one in 6.1… so he
might need to change the libc.so too… or a static build (both equally
bad!)


Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

“Mritunjai” <mritun@solitaire.hostel4.iitb.ac.in> wrote in message
news:aeqh93$d7e$1@inn.qnx.com

and look around for line that includes and . They
might provide a clue why things are going wrong. One more thing…
remove -fpic and -fhonor-std/-fno-honor-std and just use qcc

CC=qcc CXX=qcc ./configure --flags-that-you-need

I definitely need -fno-honor-std otherwise I get complaints about size_t,
it’s more STL
stuff.

| I find the most confusing part about the error to be that
| ‘get_temporary_buffer’
| is not declared within the std namespace. Doesn’t that seem weird?
After
| all, it’s in the
| header file, isn’t that considered part of the std namespace
hence
| _STD_BEGIN?

Yep. That’s how its intended to be… however I can’t really say what’s
going on until I see xalan sources.
The source code I’m using is from:

http://xml.apache.org/xalan-c/index.html
I pulled down the Linux version but it contains the sources.



Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun

– Confirmed I definitely have GNU C++ libs on my box.


“Mritunjai” <mritun@solitaire.hostel4.iitb.ac.in> wrote in message
news:aeqb7d$8jp$1@inn.qnx.com

Hi Kevin

Kevin Caporaso <> kcaporaso@pillardata.com> > wrote:
snip

| XSLT/NodeSorter.cpp:124: instantiated from here

| /usr/include/memory:246: get_temporary_buffer' undeclared in namespace | std’

These are the only relevent lines. All I can make out is that, xerces
uses GNU C++ specific constructs, so you might try 6.2 NC , which ships
with GNU C++ libs. Also check NodeSorter.cpp:124 and see if you can
track where the error is originating.

HTH

Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun