Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STL/VxWorks

191 views
Skip to first unread message

YP

unread,
Apr 8, 1999, 3:00:00 AM4/8/99
to
I'm trying to use STL (Standard Template Library) with VxWorks.
I still have some problems with multiple definitions of some symbols during
the link stage.

Explicit instanciation of template seems difficult to use as I should have
to
know all the intermediate templates that are used for each basic template.

A workaround is to create a wrapper that includes all the source files that
use
the STL and to compile it. It works for simple programs but I don't like
this solution.

The template repository should be OK but it does not seems to be completly
implemented within Tonado : With -frepo, the compiler creates the *.rpo but
the linker
ignore the repository. (Tornado does not include a tool like "collect").

Any clue anyone ?

YP

Albert Hofkamp

unread,
Apr 9, 1999, 3:00:00 AM4/9/99
to Yvon....@alcatel.fr
On Thu, 8 Apr 1999 11:23:03 +0200, YP <Yvon....@alcatel.fr> wrote:
>I'm trying to use STL (Standard Template Library) with VxWorks.
>I still have some problems with multiple definitions of some symbols during
>the link stage.

I also spend some time getting STL to work with VxWorks, but didn't succeed.
I had problems with multiple definitions of static members.

There are some tricks mentioned in the GNUtools manual about it that may
or may not solve the problem, but it seemed too much work to find out.

In essence, I am kind of annoyed that there is no better support for c++
and stl, and refuse to spend my own valuable time on things that should
be provided by vxworks in the first place (imho you cannot state that
c++ is supported if you don't provide decent stl support (it may have
been true 2 years ago when gcc 2.7.2 was the newest compiler, but not
anymore)).

(sorry, this is not about you, but it seems that every week, someone is
posting a question on the group regarding c++ and/or stl, but the guys
at windriver seem not awake).

>The template repository should be OK but it does not seems to be completly
>implemented within Tonado : With -frepo, the compiler creates the *.rpo but
>the linker
>ignore the repository. (Tornado does not include a tool like "collect").

The repo patch is a non-official (not supported or maintained by GNU)
patch for a template repository. If you want to use it, you must get the
compiler source, patch it, and build it yourself.

I have used it for some time, but got rid of it due to too long
compilation times (and because it didn't work on my x-compiler for
dos/windows, which was the platform where I wanted it for).

Albert
---
Look ma, windows without Windows !!

Rachel-Louise Koktava

unread,
Apr 10, 1999, 3:00:00 AM4/10/99
to
In article <slrn7grg...@se-46.wpa.wtb.tue.nl>, Albert Hofkamp
<h...@se-46.wpa.wtb.tue.nl> writes

>On Thu, 8 Apr 1999 11:23:03 +0200, YP <Yvon....@alcatel.fr> wrote:
>>I'm trying to use STL (Standard Template Library) with VxWorks.
>>I still have some problems with multiple definitions of some symbols during
>>the link stage.
>

There is an easy way to get around the problems of the STL and multiple
definitions. I posted an article in this newsgroup ages ago (it may have
been gnu.gcc.help) so do a search at dejanews. Fortunately the unusual
surname helps.

>e).
>
>>The template repository should be OK but it does not seems to be completly
>>implemented within Tonado : With -frepo, the compiler creates the *.rpo but
>>the linker
>>ignore the repository. (Tornado does not include a tool like "collect").
>

Actually WRS compiler is shipped with the repo patch. However, you must
make sure the GCC_EXEC_PREFIX and your path are set correctly. basically
there are two programs called 'ld', one is the real liner and the other
is 'collec2' which the repo patch patches to manage template
instantiation. You must make sure that ld aka collect2 appears first in
you path, or can be accessed by the setting of GCC_EXEC_PREFIX.

hope this helps.

RL
--
Rachel-Louise Koktava

François Lessard

unread,
Apr 12, 1999, 3:00:00 AM4/12/99
to
Hi,

I don't know which STL library you used and which compiler. I know a
portable library (not from SGI) which is called STL Port. With little
setup, you can compile STL with GNU 2.7.2 (and many other compilers) for
VxWorks. It look work fine for now!!! You can have more information at
site http://www.stlport.org/.

I hope it will be helpful for you.

François Lessard

Rachel-Louise Koktava wrote in message ...


>In article <slrn7grg...@se-46.wpa.wtb.tue.nl>, Albert Hofkamp
><h...@se-46.wpa.wtb.tue.nl> writes
>>On Thu, 8 Apr 1999 11:23:03 +0200, YP <Yvon....@alcatel.fr> wrote:
>>>I'm trying to use STL (Standard Template Library) with VxWorks.
>>>I still have some problems with multiple definitions of some symbols
during
>>>the link stage.
>>

Roberto Nunnari

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to YP
Hi

I use STLPort and it works. It was a bit hard to get it
work but now I'm quite happy with it.
http://www.stlport.org/

I used cygnus tools to configure it on a windowsNT host.
Then I use no-implicit-template. I catch the unresolved
messages from the compiler and cut and paste. It takes
several cycles to get to the points where there are no
more unresolved because templates may use other templates.

About the multiple definition I had to add a macro:
#define __PUT_STATIC_DATA_MEMBERS_HERE
in one of the source files.

Hope this helps.
--
Roberto Nunnari -software engineer-
mailto:roberto...@agie.ch
AGIE - http://www.agie.com
Via dei pioppi 16 tel: +41-91-8069138
6616 Losone """
Switzerland (o o)
=======================oOO==(_)==OOo========================
MY OPNIONS ARE NOT NECESSARELY THOSE OF MY EMPLOYER

0 new messages