"Template with C linkage" problem with vxworks powerpc cross
FERGUS CRAWFORD
CRAWFORF@whl.co.uk
Fri Aug 9 04:43:00 GMT 2002
Hi,
I am trying to upgrade my cross-compiler for vxworks from the gcc 2.7.2 that is shipped with the product. The reason for this being that I have
to make use of some external libraries that use namespaces and other features that gcc 2.7.2 does not support.
My development environment and target system are:
Host: Sun-Ultra 60 running Solaris 2.6
Target: PowerPC running vxworks
I have used binutils-2.11.2, and gcc-2.95.4 to create the cross compiler. The methodology I used to upgrade was the one that Dave Korn suggested on his web page and in his posts here. The reason being that I need to be backwards compatible with the vxworks headers and libraries - and hence the generic FAQ is not directly relevant (i.e newlib).
Anyway after something of a struggle with the fixincs and autogen I managed to get a cross compiler together that tested ok at first glance. It compiles a simple hello world programme that downloads and runs...
However there seems to be a problem whenever elements of the stl are called, and I end up with a vast no. of "template with C linkage errors".
An example error being:
In file included from /usr/local/lib/gcc-lib/powerpc-wrs-vxworks/2.95.4/include/stl_tree.h:57,
from /usr/local/powerpc-wrs-vxworks/sys-include/map:31,
from test.cc:45:
/usr/local/lib/gcc-lib/powerpc-wrs-vxworks/2.95.4/include/stl_alloc.h: At top level:
/usr/local/lib/gcc-lib/powerpc-wrs-vxworks/2.95.4/include/stl_alloc.h:92: template with C linkage
<I have snipped the rest of the (identical bar the header file) error codes, but if required they can be provided>
The compilation method used is:
powerpc-wrs-vxworks-g++ -mstrict-align -ansi -O2 -fvolatile -fno-builtin -fno-for-scope -g -x c++ -B/usr/local/lib/gcc-lib/powerpc-wrs-vxworks/2.95.4/ -DRW_MULTI_THREAD -D_REENTRANT -DCPU=3DPPC603 -DVXWORKS -DTHREAD -Dgcc272 -I/h -I/usr/local/lib/gcc-lib/powerpc-wrs-vxworks/2.95.4/include -I/usr/local/powerpc-wrs-vxworks/sys-include -I/export/home/flc/csrce/VXWORKS/tmp/Test// -I. -c test.cc -o test.o
My gut feel is that I have somehow not configured the compiler correctly ??
Or maybe I need a more up to date compiler than 2.95.4 ??
Anyway I am not an expert on building compilers and hence am now rather
stuck. Any and all help / advise would be greatly appreciated.
Regards,
Fergus Crawford
____________________________
Avionic Systems Research Section
Internal Box 255
GKN Westland Helicopters
Yeovil
Somerset
BA21 2YB
United Kingdom
Tel: (01935) 702288
Fax: (01935) 703752
____________________________
Any views or opinions expressed by the sender of this email
are not neccessarily those of GKN Westland Helicopters.
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list