ranganathan_gp
asked on
How to use c++ STL along with Rougewave collections?
We are using rouge wave library for collections. now we want to use STLs. But we are getting this error.
in any of the header file include this header.
#include<list>
then in any class of the header file
declare std::list<int> ilist;
then
Error iam Getting :
C:\viewstore\hranja01_Dev_ STL/ncp_an d/Support/ lib/libvis tact_NBX10 0.o C:\viewstore\hranja01_Dev_ STL/ncp_an d/Support/ lib/libEnc rypt_d.a C:\viewstore\hranja01_Dev_ STL\suppor ting_files _and\torna do\target/ lib/libI80 486gnuvx.a
C:\viewstore\hranja01_Dev_ STL\suppor ting_files _and\torna do\target/ lib/libI80 486gnuvx.a (stlinst.o )(.data+0x a8): multiple definition of `__default_alloc_template< true, 0>::__node_allocator_lock'
C:\viewstore\hranja01_Dev_ STL/ncp_an d/Support/ lib/libDat abaseIL_NB X100_d.a(a cdgroup.o) (.data+0x3 0):C:\view store\hran ja01_Dev_S TL\ncp_and \Support\D atabaseIL\ Profiles/a cdgroup.cp p: first defined here
collect2: ld returned 1 exit status
cc386: Internal compiler error: program ld got fatal signal 1
make[3]: *** [vxWorks] Error 0x1
Here iam getting error like:multiple definition of `__default_alloc_template< true, 0>::__node_allocator_lock'
Thanx in Adv
Ranganathan.p
in any of the header file include this header.
#include<list>
then in any class of the header file
declare std::list<int> ilist;
then
Error iam Getting :
C:\viewstore\hranja01_Dev_
C:\viewstore\hranja01_Dev_
C:\viewstore\hranja01_Dev_
collect2: ld returned 1 exit status
cc386: Internal compiler error: program ld got fatal signal 1
make[3]: *** [vxWorks] Error 0x1
Here iam getting error like:multiple definition of `__default_alloc_template<
Thanx in Adv
Ranganathan.p
ASKER
declare means writing std::list<int> ilist in any of the .h file. in fact this is the definition too.
clean and build is not working.
we are using STLs provided by HP. I am unable to find where is the other definition.
regards
ranga & himanshu
clean and build is not working.
we are using STLs provided by HP. I am unable to find where is the other definition.
regards
ranga & himanshu
'declare' isn't a valid C++ keyword. I would like to know whether you have a statement like
declare std::list<int> ilist;
in your code or if you simply want to say that you declared a variable
std::list<int> ilist;
in a class.
>>>> we are using STLs provided by HP.
STL comes with the compiler. From the warnings and errors I see you are using GNU compiler. HP seems to be the hardware supplier but I don't think you got an STL from HP.
>>>> RogueWave
Do you want to *change* from RogueWave to STL or do you need *both* ?
>>>> .../libI80486gnuvx.a(stlin st.o)(.dat a+0xa8):
>>>> multiple definition of `__default_alloc_template< true, 0>::__node_allocator_lock'
From that error I can see that the error occurs when trying to create an object file named 'stlinst.o'. The source of that object is 'stlinst.cpp', 'stlinst.cxx', 'stlinst.cc' or 'stlinst.C'. From the name I would deduce it has something todo with explicit template instantiation, what isn't necessary when using STL (use implicit instantiation instead). So, try to locate the stlinst source in your makefile/project file and remove it from build (save old file before). After that, clean the project and make a rebuild.
Good Luck,
Alex
declare std::list<int> ilist;
in your code or if you simply want to say that you declared a variable
std::list<int> ilist;
in a class.
>>>> we are using STLs provided by HP.
STL comes with the compiler. From the warnings and errors I see you are using GNU compiler. HP seems to be the hardware supplier but I don't think you got an STL from HP.
>>>> RogueWave
Do you want to *change* from RogueWave to STL or do you need *both* ?
>>>> .../libI80486gnuvx.a(stlin
>>>> multiple definition of `__default_alloc_template<
From that error I can see that the error occurs when trying to create an object file named 'stlinst.o'. The source of that object is 'stlinst.cpp', 'stlinst.cxx', 'stlinst.cc' or 'stlinst.C'. From the name I would deduce it has something todo with explicit template instantiation, what isn't necessary when using STL (use implicit instantiation instead). So, try to locate the stlinst source in your makefile/project file and remove it from build (save old file before). After that, clean the project and make a rebuild.
Good Luck,
Alex
ASKER
we have no sorce code of any of the file stlinst.cpp,stlinst.cxx,st linst.cc or stlinst.c.
stlinst.o is there in one of the archive C:\viewstore\rparam01_view 6\supporti ng_files_a nd\tornado \target/li b/libI8048 6gnuvx.a
we are writing only this peace of code.
in the file named acdgroup.h,
#include<list>
class ACDGroup
{
public:
std::list<int> ilist;
};
this class also contains other stuffs including rogue wave collections.
we are fighting day and night to solve this problem but of no avail. please guide us.
the error we are getting is:
!> Linking ASysContainer
make[4]: Leaving directory `C:\viewstore\rparam01_vie w6\callp_v oice_and\B usiness\Ca llP\RoseRT \Context_N BX100\buil d'
make[3]: Leaving directory `C:\viewstore\rparam01_vie w6\callp_v oice_and\B usiness\Ca llP\RoseRT \Context_N BX100'
make[2]: Leaving directory `C:\viewstore\rparam01_vie w6\callp_v oice_and\B usiness\Ca llP\RoseRT '
make \
--directory \
C:\viewstore\rparam01_view 6/supporti ng_files_a nd/tornado /target/co nfig/pc486 _NCP_NBX10 0
make[2]: Entering directory `C:\viewstore\rparam01_vie w6\support ing_files_ and\tornad o\target\c onfig\pc48 6_NCP_NBX1 00'
make -f release.mk
make[3]: Entering directory `C:\viewstore\rparam01_vie w6\support ing_files_ and\tornad o\target\c onfig\pc48 6_NCP_NBX1 00'
cc386 -BC:\viewstore\rparam01_vi ew6\suppor ting_files _and\torna do/host/x8 6-win32/li b/gcc-lib/ -c -m486 -ansi -nostdinc -O -fvolatile -nostdlib -fno-builtin -fno-defer-pop -Wall -I/h -I. -IC:\viewstor
e\rparam01_view6\supportin g_files_an d\tornado\ target\con fig\all -IC:\viewstore\rparam01_vi ew6\suppor ting_files _and\torna do\target/ h -IC:\viewstore\rparam01_vi ew6\suppor ting_files _and\torna do\target/ sr
c/config -IC:\viewstore\rparam01_vi ew6\suppor ting_files _and\torna do\target/ src/drv -DCPU=I80486 -DNBX_PRODUCT_NBX100 -DINCLUDE_USER_APPL -DUSER_APPL_INIT="NBX100Sy stemInit() " -DINCLUDE_NET_SYM_TBL
-g -o version.o C:\viewstore\rparam01_view 6\supporti ng_files_a nd\tornado \target\co nfig\all/v ersion.c
cc386 -BC:\viewstore\rparam01_vi ew6\suppor ting_files _and\torna do/host/x8 6-win32/li b/gcc-lib/ -nostdlib -r -Wl,-X \
-o vxWorks.tmp sysALib.o sysLib.o csend.o ftpdlib.o usrConfig.o version.o C:\viewstore\rparam01_view 6/callp_vo ice_and/Bu siness/Cal lP/RoseRT/ Context_NB X100/build /ASysConta iner C:\viewstore\rparam0
1_view6/ncp_and/Support/HT TPServer/o bj.vxworks .NBX100/tE mWeb_NBX10 0.o C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libRTOS_ NBX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libVoice Mail_NB
X100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libAutoA ttendant_N BX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libOffSi teNotifica tion_NBX10 0_d.a C:\viewstore\rparam01_view 6/ncp_a
nd/Support/lib/libVoiceApp Utils_NBX1 00_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libDatab aseIL_NBX1 00_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libDevic eIL_NBX100 _d.a C:\viewstore\
rparam01_view6/ncp_and/Sup port/lib/l ibDeviceUI _NBX100_d. a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libDownl oader_NBX1 00_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libDirec toryServic es_
NBX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libIMAP_ NBX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libLogge r_NBX100_d .a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libMe
diaServer_NBX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libNetwo rk_NBX100_ d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libRDC_N BX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support
/lib/libUtils_NBX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libVAppI L_NBX100_d .a C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libi18n_ NBX100_d.a C:\viewstore\rparam01_view 6/ncp_and/ Sup
port/lib/libvistact_NBX100 .o C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libEncry pt_d.a C:\viewstore\rparam01_view 6\supporti ng_files_a nd\tornado \target/li b/libI8048 6gnuvx.a
C:\viewstore\rparam01_view 6\supporti ng_files_a nd\tornado \target/li b/libI8048 6gnuvx.a(s tlinst.o)( .data+0xa8 ): multiple definition of `__default_alloc_template< true, 0>::__node_allocator_lock'
C:\viewstore\rparam01_view 6/ncp_and/ Support/li b/libDatab aseIL_NBX1 00_d.a(acd group.o)(. data+0x30) :C:\viewst ore\rparam 01_view6\n cp_and\Sup port\Datab aseIL\Prof iles/acdgr oup.cpp: first defined here
collect2: ld returned 1 exit status
cc386: Internal compiler error: program ld got fatal signal 1
make[3]: *** [vxWorks] Error 0x1
make[3]: Leaving directory `C:\viewstore\rparam01_vie w6\support ing_files_ and\tornad o\target\c onfig\pc48 6_NCP_NBX1 00'
make[2]: *** [exe] Error 0x2
make[2]: Leaving directory `C:\viewstore\rparam01_vie w6\support ing_files_ and\tornad o\target\c onfig\pc48 6_NCP_NBX1 00'
make[1]: *** [link] Error 0x2
make[1]: Leaving directory `C:\viewstore\rparam01_vie w6\ncp_and '
make: *** [build_nbx100] Error 0x2
regards
Ranga & himanshu
stlinst.o is there in one of the archive C:\viewstore\rparam01_view
we are writing only this peace of code.
in the file named acdgroup.h,
#include<list>
class ACDGroup
{
public:
std::list<int> ilist;
};
this class also contains other stuffs including rogue wave collections.
we are fighting day and night to solve this problem but of no avail. please guide us.
the error we are getting is:
!> Linking ASysContainer
make[4]: Leaving directory `C:\viewstore\rparam01_vie
make[3]: Leaving directory `C:\viewstore\rparam01_vie
make[2]: Leaving directory `C:\viewstore\rparam01_vie
make \
--directory \
C:\viewstore\rparam01_view
make[2]: Entering directory `C:\viewstore\rparam01_vie
make -f release.mk
make[3]: Entering directory `C:\viewstore\rparam01_vie
cc386 -BC:\viewstore\rparam01_vi
e\rparam01_view6\supportin
c/config -IC:\viewstore\rparam01_vi
-g -o version.o C:\viewstore\rparam01_view
cc386 -BC:\viewstore\rparam01_vi
-o vxWorks.tmp sysALib.o sysLib.o csend.o ftpdlib.o usrConfig.o version.o C:\viewstore\rparam01_view
1_view6/ncp_and/Support/HT
X100_d.a C:\viewstore\rparam01_view
nd/Support/lib/libVoiceApp
rparam01_view6/ncp_and/Sup
NBX100_d.a C:\viewstore\rparam01_view
diaServer_NBX100_d.a C:\viewstore\rparam01_view
/lib/libUtils_NBX100_d.a C:\viewstore\rparam01_view
port/lib/libvistact_NBX100
C:\viewstore\rparam01_view
C:\viewstore\rparam01_view
collect2: ld returned 1 exit status
cc386: Internal compiler error: program ld got fatal signal 1
make[3]: *** [vxWorks] Error 0x1
make[3]: Leaving directory `C:\viewstore\rparam01_vie
make[2]: *** [exe] Error 0x2
make[2]: Leaving directory `C:\viewstore\rparam01_vie
make[1]: *** [link] Error 0x2
make[1]: Leaving directory `C:\viewstore\rparam01_vie
make: *** [build_nbx100] Error 0x2
regards
Ranga & himanshu
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the environment is
vxWorks 5.40
compiler gnu cc386
tornado 2.0
we tried every thing you suggested but its not working.
regards
ranga & himanshu
vxWorks 5.40
compiler gnu cc386
tornado 2.0
we tried every thing you suggested but its not working.
regards
ranga & himanshu
ASKER
thanks for all posting from Alex
From his answers.I found he is a knowledgeble person in this topic
Thanks Alex
From his answers.I found he is a knowledgeble person in this topic
Thanks Alex
Thanks.
I am sorry that it isn't working.
Regards, Alex
I am sorry that it isn't working.
Regards, Alex
do you mean 'typedef' instead of 'declare' ???
>>>> We are using rouge wave library for collections.
How do you know the error was caused by RogueWave libraries/includes ???
If you use Roquewave libraries you need to build/use a library version that is compatible to STL. Check your RoqueWave installation guide for that. Furthermore, you have to remove the RW_NO_STL macro from your projects.
>>>> multiple definition of `__default_alloc_template<
That error could be caused by two STL libraries, e. g. Microsoft STL and STL-Port. Or a clean and rebuild could solve the problem
Regards, Alex