Link to home
Start Free TrialLog in
Avatar of ranganathan_gp
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_and/Support/lib/libvistact_NBX100.o C:\viewstore\hranja01_Dev_STL/ncp_and/Support/lib/libEncrypt_d.a C:\viewstore\hranja01_Dev_STL\supporting_files_and\tornado\target/lib/libI80486gnuvx.a
C:\viewstore\hranja01_Dev_STL\supporting_files_and\tornado\target/lib/libI80486gnuvx.a(stlinst.o)(.data+0xa8): multiple definition of `__default_alloc_template<true, 0>::__node_allocator_lock'
C:\viewstore\hranja01_Dev_STL/ncp_and/Support/lib/libDatabaseIL_NBX100_d.a(acdgroup.o)(.data+0x30):C:\viewstore\hranja01_Dev_STL\ncp_and\Support\DatabaseIL\Profiles/acdgroup.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

Here iam getting error like:multiple definition of `__default_alloc_template<true, 0>::__node_allocator_lock'
 

Thanx in Adv
Ranganathan.p
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

>>>> declare std::list<int> ilist;

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<true, 0>::__node_allocator_lock'

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


Avatar of ranganathan_gp
ranganathan_gp

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
'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(stlinst.o)(.data+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
we have no sorce code of any of the file stlinst.cpp,stlinst.cxx,stlinst.cc or stlinst.c.
stlinst.o is there in one of the archive C:\viewstore\rparam01_view6\supporting_files_and\tornado\target/lib/libI80486gnuvx.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_view6\callp_voice_and\Business\CallP\RoseRT\Context_NBX100\build'
make[3]: Leaving directory `C:\viewstore\rparam01_view6\callp_voice_and\Business\CallP\RoseRT\Context_NBX100'
make[2]: Leaving directory `C:\viewstore\rparam01_view6\callp_voice_and\Business\CallP\RoseRT'
make \
        --directory \
                C:\viewstore\rparam01_view6/supporting_files_and/tornado/target/config/pc486_NCP_NBX100
make[2]: Entering directory `C:\viewstore\rparam01_view6\supporting_files_and\tornado\target\config\pc486_NCP_NBX100'
make -f release.mk
make[3]: Entering directory `C:\viewstore\rparam01_view6\supporting_files_and\tornado\target\config\pc486_NCP_NBX100'
cc386 -BC:\viewstore\rparam01_view6\supporting_files_and\tornado/host/x86-win32/lib/gcc-lib/ -c -m486 -ansi -nostdinc -O -fvolatile -nostdlib -fno-builtin -fno-defer-pop -Wall -I/h   -I. -IC:\viewstor
e\rparam01_view6\supporting_files_and\tornado\target\config\all -IC:\viewstore\rparam01_view6\supporting_files_and\tornado\target/h -IC:\viewstore\rparam01_view6\supporting_files_and\tornado\target/sr
c/config -IC:\viewstore\rparam01_view6\supporting_files_and\tornado\target/src/drv -DCPU=I80486   -DNBX_PRODUCT_NBX100 -DINCLUDE_USER_APPL -DUSER_APPL_INIT="NBX100SystemInit()" -DINCLUDE_NET_SYM_TBL
-g -o version.o C:\viewstore\rparam01_view6\supporting_files_and\tornado\target\config\all/version.c
cc386 -BC:\viewstore\rparam01_view6\supporting_files_and\tornado/host/x86-win32/lib/gcc-lib/ -nostdlib -r -Wl,-X \
    -o vxWorks.tmp sysALib.o sysLib.o csend.o ftpdlib.o  usrConfig.o version.o C:\viewstore\rparam01_view6/callp_voice_and/Business/CallP/RoseRT/Context_NBX100/build/ASysContainer C:\viewstore\rparam0
1_view6/ncp_and/Support/HTTPServer/obj.vxworks.NBX100/tEmWeb_NBX100.o C:\viewstore\rparam01_view6/ncp_and/Support/lib/libRTOS_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libVoiceMail_NB
X100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libAutoAttendant_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libOffSiteNotification_NBX100_d.a C:\viewstore\rparam01_view6/ncp_a
nd/Support/lib/libVoiceAppUtils_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libDatabaseIL_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libDeviceIL_NBX100_d.a C:\viewstore\
rparam01_view6/ncp_and/Support/lib/libDeviceUI_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libDownloader_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libDirectoryServices_
NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libIMAP_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libLogger_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libMe
diaServer_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libNetwork_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libRDC_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support
/lib/libUtils_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libVAppIL_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Support/lib/libi18n_NBX100_d.a C:\viewstore\rparam01_view6/ncp_and/Sup
port/lib/libvistact_NBX100.o C:\viewstore\rparam01_view6/ncp_and/Support/lib/libEncrypt_d.a C:\viewstore\rparam01_view6\supporting_files_and\tornado\target/lib/libI80486gnuvx.a
C:\viewstore\rparam01_view6\supporting_files_and\tornado\target/lib/libI80486gnuvx.a(stlinst.o)(.data+0xa8): multiple definition of `__default_alloc_template<true, 0>::__node_allocator_lock'
C:\viewstore\rparam01_view6/ncp_and/Support/lib/libDatabaseIL_NBX100_d.a(acdgroup.o)(.data+0x30):C:\viewstore\rparam01_view6\ncp_and\Support\DatabaseIL\Profiles/acdgroup.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_view6\supporting_files_and\tornado\target\config\pc486_NCP_NBX100'
make[2]: *** [exe] Error 0x2
make[2]: Leaving directory `C:\viewstore\rparam01_view6\supporting_files_and\tornado\target\config\pc486_NCP_NBX100'
make[1]: *** [link] Error 0x2
make[1]: Leaving directory `C:\viewstore\rparam01_view6\ncp_and'
make: *** [build_nbx100] Error 0x2


regards
Ranga & himanshu
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
thanks for all posting from 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