WATCOM compiler and STL

Hallo,

Does anybody have experiences in using WATCOM compiler and STL (STLport.org) ?

I tried to compile a project, and recognized problems. I use wpp386 (V 10.6) STL
(V4.0).

Any hints apreciated?
Alexander

################################################

Stacom Softwareentwicklung Alexander Eisenhuth

Goethestr. 13

78467 Konstanz

Tel 07531-958922

Fax 07531-958925

Email: stacom@topmail.de

#################################################

I’m using an older version of stlport, haven’t bothered upgrading yet. It’s hard
to give hints without you giving some details on what you did…

Sam

Previously, Alexander Eisenhuth wrote in comp.os.qnx:

Hallo,

Does anybody have experiences in using WATCOM compiler and STL (STLport.org) ?

I tried to compile a project, and recognized problems. I use wpp386 (V 10.6) STL
(V4.0).

Any hints apreciated?
Alexander

################################################

Stacom Softwareentwicklung Alexander Eisenhuth

Goethestr. 13

78467 Konstanz

Tel 07531-958922

Fax 07531-958925

Email: > stacom@topmail.de

#################################################


Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca)
“News is very popular among its readers.” - RFC 977 (NNTP)

What type of problems? I’m using the new version with no problems other
than being able to compile the SGI iostreams…

Jon

Alexander Eisenhuth <stacom@topmail.de> wrote in message
news:39748DCA.67056F51@topmail.de

Hallo,

Does anybody have experiences in using WATCOM compiler and STL
(STLport.org) ?

I tried to compile a project, and recognized problems. I use wpp386 (V
10.6) STL
(V4.0).

Any hints apreciated?
Alexander

################################################

Stacom Softwareentwicklung Alexander Eisenhuth

Goethestr. 13

78467 Konstanz

Tel 07531-958922

Fax 07531-958925

Email: > stacom@topmail.de

#################################################

Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include

main () {
stack buffer;
}


wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/include
-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(5): Error! E213: (col 18) class template requires more parameters for
instantiation
test.cpp: 7 lines, included 9832, no warnings, 1 error
make: *** [test.o] Error 2

Also wpp seems not to know the using keyword

using namespace std;

test.cpp(3): Error! E336: (col 20) declaration specifiers are required to
declare ‘using’
test.cpp(3): Error! E498: (col 7) syntax error before ‘namespace’; probable
cause: incorrectly spelled type


Alexander

Previously, Alexander Eisenhuth wrote in comp.os.qnx:

Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include <stack

main () {
stack buffer;
}

Watcom is pre ANSI, you’ll need to specify an allocator and namespaces
are not implimented.

main () {
stack<int, allocator> buffer;
}

I find that it’s good to use typedefs with Watcom, ie:
typedef stack<int, allocator> intStack;
typedef stack<int, allocator>::iterator intStackIt;

main () {
intStack buffer;
}

wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/include
-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(5): Error! E213: (col 18) class template requires more parameters for
instantiation
test.cpp: 7 lines, included 9832, no warnings, 1 error
make: *** [test.o] Error 2

Also wpp seems not to know the using keyword

using namespace std;

test.cpp(3): Error! E336: (col 20) declaration specifiers are required to
declare ‘using’
test.cpp(3): Error! E498: (col 7) syntax error before ‘namespace’; probable
cause: incorrectly spelled type


Alexander


David L. Hawley D.L. Hawley and Associates

“David L. Hawley” wrote:

Previously, Alexander Eisenhuth wrote in comp.os.qnx:
Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include <stack

main () {
stack buffer;
}

Watcom is pre ANSI, you’ll need to specify an allocator and namespaces
are not implimented.

main () {
stack<int, allocator> buffer;
}

I find that it’s good to use typedefs with Watcom, ie:
typedef stack<int, allocator> intStack;
typedef stack<int, allocator>::iterator intStackIt;

main () {
intStack buffer;
}

somehow this is a problem:

#include

typedef stack<int, allocator> intStack;

main () {
intStack buffer;
}

wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/include
-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(3): Error! E121: (col 29) syntax error
test.cpp(6): Error! E006: (col 18) syntax error; probable cause: missing ‘;’
test.cpp: 7 lines, included 9832, no warnings, 2 errors

What may be the problem. Does this code work with your compiler ??

Thanks
Alexander

Jon will probably be able to give you more specific suggestions,
but Watcom supports neither namespaces nor default template parameters.
Since stack<> is an interface to some other container, it needs to
have that container type specified. It’s supposed to default to something,
but the defaulting uses a default template parameter, so no worky under
Watcom.

Sam

Previously, Alexander Eisenhuth wrote in comp.os.qnx:

Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include <stack

main () {
stack buffer;
}


wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/include
-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(5): Error! E213: (col 18) class template requires more parameters for
instantiation
test.cpp: 7 lines, included 9832, no warnings, 1 error
make: *** [test.o] Error 2

Also wpp seems not to know the using keyword

using namespace std;

test.cpp(3): Error! E336: (col 20) declaration specifiers are required to
declare ‘using’
test.cpp(3): Error! E498: (col 7) syntax error before ‘namespace’; probable
cause: incorrectly spelled type


Alexander


Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca)
“News is very popular among its readers.” - RFC 977 (NNTP)

Hello,

Your stack example should work fine. The second paramater is supposed to
default to a deque. I haven’t used stack yet but taking a look at it there
is some define called “__STL_LIMITED_DEFAULT_TEMPLATES” that probably gets
set in one of the config.h files. I think I would just specify the second
argument myself intead of playing with all the configuration ifdefs in
Stlport. eg:

stack<int, deque > mystack;

The default is a deque, you can use whatever you want…

And the Watcom compiler doesn’t support namespaces so you don’t need (and
can’t) the usual using namespace std; which is a bit unfortunate. There is a
gcc port avail. for QNX but I haven’t used it too much. The gcc compiler
that comes with Neutrino is good though.

Let me know if you have any other questions.

Jon

Alexander Eisenhuth <stacom@topmail.de> wrote in message
news:39755B27.E220919F@topmail.de

Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include <stack

main () {
stack buffer;
}



wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/inclu

de

-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(5): Error! E213: (col 18) class template requires more parameters
for
instantiation
test.cpp: 7 lines, included 9832, no warnings, 1 error
make: *** [test.o] Error 2

Also wpp seems not to know the using keyword

using namespace std;

test.cpp(3): Error! E336: (col 20) declaration specifiers are required to
declare ‘using’
test.cpp(3): Error! E498: (col 7) syntax error before ‘namespace’;
probable
cause: incorrectly spelled type


Alexander

aah yes, watcom doesn’t support default template params… so don’t play
around with the ifdef I mentioned below!

Jon

Sam Roberts <sam@cogent.ca> wrote in message
news:Voyager.000719120142.12674B@sam.cogent.ca

Jon will probably be able to give you more specific suggestions,
but Watcom supports neither namespaces nor default template parameters.
Since stack<> is an interface to some other container, it needs to
have that container type specified. It’s supposed to default to something,
but the defaulting uses a default template parameter, so no worky under
Watcom.

Sam

Previously, Alexander Eisenhuth wrote in comp.os.qnx:
Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems
other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include <stack

main () {
stack buffer;
}



wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/inclu

de

-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(5): Error! E213: (col 18) class template requires more
parameters for
instantiation
test.cpp: 7 lines, included 9832, no warnings, 1 error
make: *** [test.o] Error 2

Also wpp seems not to know the using keyword

using namespace std;

test.cpp(3): Error! E336: (col 20) declaration specifiers are required
to
declare ‘using’
test.cpp(3): Error! E498: (col 7) syntax error before ‘namespace’;
probable
cause: incorrectly spelled type


Alexander

\

Sam Roberts (> sam@cogent.ca> ), Cogent Real-Time Systems (> www.cogent.ca> )
“News is very popular among its readers.” - RFC 977 (NNTP)

Previously, Alexander Eisenhuth wrote in comp.os.qnx:

somehow this is a problem:

#include <stack

typedef stack<int, allocator> intStack;

Somehow?

See http://www.sgi.com/Technology/STL/stack.html.

The stack is template <T, Sequence = deque>, but defaults aren’t
allowed so try putting the default in yourself.

typedef stack<int, deque> intStack;

You may find that deque<> needs a parameter that is usually specified
by a default template paramter, if so follow the docs to see what that
is.

I think the previous poster was typing too fast, there are places in the
STL where an allocator is specified by a default template parameter, and
this is probably one of the most requently asked questions, but
if you look at the docs for stack you’ll see that what is required is
a container. Read the docs for container adaptors, and for stack.

wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/include
-i=…/inc test.cpp

Also, are you providing this command line yourself? I would recommend using
dwarf debugging format, watcom’s has some hardcoded limits that you’ll reach
quickly with C++ and the STL in particular, and always use the cc front end:

/tmp$ cc -g3d -c _.cc
/usr/watcom/10.6/bin/wpp386 -zq -d3 -hd -ms -4r -i=/usr/watcom/10.6/usr/include i=/usr/include _.cc

Sam


Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca)
“News is very popular among its readers.” - RFC 977 (NNTP)

Hi,

thanks a lot for your help. Me and the compiler are fine with

typedef stack<int,deque > intStack;

Alexander

Previously, Sam Roberts wrote in comp.os.qnx:

Previously, Alexander Eisenhuth wrote in comp.os.qnx:

somehow this is a problem:

#include <stack

typedef stack<int, allocator> intStack;

Somehow?

See > http://www.sgi.com/Technology/STL/stack.html> .

The stack is template <T, Sequence = deque>, but defaults aren’t
allowed so try putting the default in yourself.

typedef stack<int, deque> intStack;

You may find that deque<> needs a parameter that is usually specified
by a default template paramter, if so follow the docs to see what that
is.

I think the previous poster was typing too fast, there are places in the
STL where an allocator is specified by a default template parameter, and
this is probably one of the most requently asked questions, but
if you look at the docs for stack you’ll see that what is required is
a container. Read the docs for container adaptors, and for stack.

Yes, I’ve not used stack before and just assumed that it was like
vector<> which does need the allocator…


David L. Hawley D.L. Hawley and Associates

Just to follow up on this discussion, if you set

__STL_MINIMUM_DEFAULT_TEMPLATE_PARAMS to 1 in stl_user_config.h

then you can indeed write

stack mystack; // Uses default deque

The downside of this is that now, if you DO want to override the default
then you have to use an alternate form like

stack<int, deque> mystack2;

The same applies to map<>, multimap<>, set<>, multiset<>, queue<> etc. This
is all documented in stl_user_config.h (probably in the docs too but I
didn’t look).

Rob Rutherford


“Jonathan Richardson” <jrichard@nospam.ise.bc.ca> wrote in message
news:8Ukd5.1765$47.68937@news.bc.tac.net

Hello,

Your stack example should work fine. The second paramater is supposed to
default to a deque. I haven’t used stack yet but taking a look at it there
is some define called “__STL_LIMITED_DEFAULT_TEMPLATES” that probably gets
set in one of the config.h files. I think I would just specify the second
argument myself intead of playing with all the configuration ifdefs in
Stlport. eg:

stack<int, deque > mystack;

The default is a deque, you can use whatever you want…

And the Watcom compiler doesn’t support namespaces so you don’t need (and
can’t) the usual using namespace std; which is a bit unfortunate. There is
a
gcc port avail. for QNX but I haven’t used it too much. The gcc compiler
that comes with Neutrino is good though.

Let me know if you have any other questions.

Jon

Alexander Eisenhuth <> stacom@topmail.de> > wrote in message
news:> 39755B27.E220919F@topmail.de> …
Jonathan Richardson wrote:

What type of problems? I’m using the new version with no problems
other
than being able to compile the SGI iostreams…

Jon

Thanks for the response.

problem with container:

#include <stack

main () {
stack buffer;
}




wpp386 -d3 -db -bt=QNX -hw -i=/prj/gmc/dvp/STLport-4.0/stlport -i=/usr/inclu
de
-i=…/inc test.cpp
WATCOM C++32 Optimizing Compiler Version 10.6
Copyright by WATCOM International Corp. 1989, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
test.cpp(5): Error! E213: (col 18) class template requires more
parameters
for
instantiation
test.cpp: 7 lines, included 9832, no warnings, 1 error
make: *** [test.o] Error 2

Also wpp seems not to know the using keyword

using namespace std;

test.cpp(3): Error! E336: (col 20) declaration specifiers are required
to
declare ‘using’
test.cpp(3): Error! E498: (col 7) syntax error before ‘namespace’;
probable
cause: incorrectly spelled type


Alexander