Using Vectors. MinGW warning

This is a discussion on Using Vectors. MinGW warning within the C++ Programming forums, part of the General Programming Boards category; I use Code::Blocks 8.2, MinGW(gcc-g++-3.4.5-20060117-1-vista). Code: #include <vector> #include <string> using namespace std; vector<vector<string> > Foo() { vector<vector<string> > vs(15, ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Using Vectors. MinGW warning

    I use Code::Blocks 8.2, MinGW(gcc-g++-3.4.5-20060117-1-vista).
    Code:
    #include <vector>
    #include <string>
    
    using namespace std;
    
    vector<vector<string> > Foo()
    {
        vector<vector<string> > vs(15, vector<string>(15, "test"));
        return vs;
    }
    
    int main()
    {
    
        vector<vector<string> > vvs = Foo();
        return 0;
    }
    MinGW warning:

    C:\Program Files\CodeBlocks\MINGW\bin\..\lib\gcc\mingw32\3.4. 5\..\..\..\..\include\c++\3.4.5\bits\stl_uninitial ized.h|82|warning: '__cur' might be used uninitialized in this function|

    if I use another code

    Code:
    void Foo(vector<vector<string> > &vvs)
    {
        vvs.resize(15, vector<string>(15, "test"));
    }
    
    int main()
    {
        vector<vector<string> > vvs;
        Foo(vvs);
        return 0;
    }
    then I get 12 warnings.

    What is wrong with this code?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,772
    Nothing is wrong with your code. The compiler warning applies to the standard library implementation, and it is probably benign. I am using the MinGW port of g++ 3.4.5 and do not get such a warning, so it could be due to a particular version of the standard library implementation.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    10
    Quote Originally Posted by laserlight View Post
    I am using the MinGW port of g++ 3.4.5 and do not get such a warning
    I use -W and -Wall compiler flags. If I switch off it then I do not get such a warning too.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,772
    Quote Originally Posted by Viewer
    I use -W and -Wall compiler flags. If I switch off it then I do not get such a warning too.
    Ah, but compiler warnings can detect genuine problems with your code. It is just that in this case they are benign, possibly due to an oversight in the standard library implementation.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    BTW, GCC 4.3 is available on the MinGW download page.

    *off topic* I'm getting really impatient waiting for GCC 4.4... it has been frozen for quite a few months already. */off topic*

  6. #6
    Registered User
    Join Date
    Jan 2009
    Posts
    10
    Quote Originally Posted by laserlight View Post
    Ah, but compiler warnings can detect genuine problems with your code.
    Yes. If a get 100 false warnings then I can't see genuine problems. Can I hide this specific code for compiler warnings? May be some #pragma will help me?
    Quote Originally Posted by cyberfish View Post
    BTW, GCC 4.3 is available on the MinGW download page.
    Only alpha available. I tested this unofficial replacements

    TDM's GCC/mingw32 Builds

    but it recommended for experimentation purposes only.
    Last edited by Viewer; 03-26-2009 at 03:32 AM.

  7. #7
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    This is what I get when I try to compile your code -- oh wait, nevermind.

    For some reason I thought that gcc and g++ were exchangeable or something. G++ works, GCC doesn't, the extreme errors that GCC spits out are hilarious

    Code:
    C:\Documents and Settings\Colin Diesh>gcc Test.cpp
    Test.cpp:17:2: warning: no newline at end of file
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x12): undefined r
    eference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x6d): undefined r
    eference to `std::allocator<char>::allocator()'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x91): undefined r
    eference to `std::basic_string<char, std::char_traits<char>, std::allocator<char
    > >::basic_string(char const*, std::allocator<char> const&)'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x187): undefined
    reference to `std::basic_string<char, std::char_traits<char>, std::allocator<cha
    r> >::~basic_string()'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x1aa): undefined
    reference to `std::basic_string<char, std::char_traits<char>, std::allocator<cha
    r> >::~basic_string()'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x1c3): undefined
    reference to `std::allocator<char>::~allocator()'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text+0x1dc): undefined
    reference to `std::allocator<char>::~allocator()'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt6vectorISsSaI
    SsEEC1EjRKSsRKS0_[std::vector<std::basic_string<char, std::char_traits<char>, st
    d::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<ch
    ar>, std::allocator<char> > > >::vector(unsigned int, std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > const&, std::allocator<std::basic_s
    tring<char, std::char_traits<char>, std::allocator<char> > > const&)]+0xc): unde
    fined reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt6vectorISsSaI
    SsEED1Ev[std::vector<std::basic_string<char, std::char_traits<char>, std::alloca
    tor<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std:
    :allocator<char> > > >::~vector()]+0xc): undefined reference to `__gxx_personali
    ty_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt6vectorIS_ISs
    SaISsEESaIS1_EEC1EjRKS1_RKS2_[std::vector<std::vector<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<c
    har, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vec
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std:
    :allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>
    > > > > >::vector(unsigned int, std::vector<std::basic_string<char, std::char_tr
    aits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::
    char_traits<char>, std::allocator<char> > > > const&, std::allocator<std::vector
    <std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::al
    locator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
     > > const&)]+0xc): undefined reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt6vectorIS_ISs
    SaISsEESaIS1_EED1Ev[std::vector<std::vector<std::basic_string<char, std::char_tr
    aits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::
    char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator
    <std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >:
    :~vector()]+0xc): undefined reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt12_Vector_bas
    eISsSaISsEEC2EjRKS0_[std::_Vector_base<std::basic_string<char, std::char_traits<
    char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_
    traits<char>, std::allocator<char> > > >::_Vector_base(unsigned int, std::alloca
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > con
    st&)]+0xc): undefined reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt12_Vector_bas
    eISsSaISsEED2Ev[std::_Vector_base<std::basic_string<char, std::char_traits<char>
    , std::allocator<char> >, std::allocator<std::basic_string<char, std::char_trait
    s<char>, std::allocator<char> > > >::~_Vector_base()]+0xc): more undefined refer
    ences to `__gxx_personality_sj0' follow
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSsjSsET_S1_T0_RKT1_12__false_type[std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> >* std::__uninitialized_fill_n_aux<std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int,
     std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int,
     std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
    __false_type)]+0x76): undefined reference to `__cxa_begin_catch'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSsjSsET_S1_T0_RKT1_12__false_type[std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> >* std::__uninitialized_fill_n_aux<std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int,
     std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int,
     std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
    __false_type)]+0x94): undefined reference to `__cxa_rethrow'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSsjSsET_S1_T0_RKT1_12__false_type[std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> >* std::__uninitialized_fill_n_aux<std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int,
     std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::b
    asic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int,
     std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
    __false_type)]+0xb7): undefined reference to `__cxa_end_catch'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSt6vectorISsSaISsEEjS2_ET_S4_T0_RKT1_12__false_type[std::vector<
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::all
    ocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
    >* std::__uninitialized_fill_n_aux<std::vector<std::basic_string<char, std::char
    _traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > > >*, unsigned int, std::vector<std
    ::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::alloca
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >
    (std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char
    > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocat
    or<char> > > >*, unsigned int, std::vector<std::basic_string<char, std::char_tra
    its<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> > > > const&, __false_type)]+0xc): undefi
    ned reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSt6vectorISsSaISsEEjS2_ET_S4_T0_RKT1_12__false_type[std::vector<
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::all
    ocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
    >* std::__uninitialized_fill_n_aux<std::vector<std::basic_string<char, std::char
    _traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > > >*, unsigned int, std::vector<std
    ::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::alloca
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >
    (std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char
    > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocat
    or<char> > > >*, unsigned int, std::vector<std::basic_string<char, std::char_tra
    its<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> > > > const&, __false_type)]+0x76): undef
    ined reference to `__cxa_begin_catch'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSt6vectorISsSaISsEEjS2_ET_S4_T0_RKT1_12__false_type[std::vector<
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::all
    ocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
    >* std::__uninitialized_fill_n_aux<std::vector<std::basic_string<char, std::char
    _traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > > >*, unsigned int, std::vector<std
    ::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::alloca
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >
    (std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char
    > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocat
    or<char> > > >*, unsigned int, std::vector<std::basic_string<char, std::char_tra
    its<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> > > > const&, __false_type)]+0x94): undef
    ined reference to `__cxa_rethrow'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt26__uninitiali
    zed_fill_n_auxIPSt6vectorISsSaISsEEjS2_ET_S4_T0_RKT1_12__false_type[std::vector<
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::all
    ocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
    >* std::__uninitialized_fill_n_aux<std::vector<std::basic_string<char, std::char
    _traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > > >*, unsigned int, std::vector<std
    ::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::alloca
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >
    (std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char
    > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocat
    or<char> > > >*, unsigned int, std::vector<std::basic_string<char, std::char_tra
    its<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::c
    har_traits<char>, std::allocator<char> > > > const&, __false_type)]+0xb7): undef
    ined reference to `__cxa_end_catch'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZN9__gnu_cxx13new
    _allocatorISsE8allocateEjPKv[__gnu_cxx::new_allocator<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > >::allocate(unsigned int, void cons
    t*)]+0x10): undefined reference to `operator new(unsigned int)'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZN9__gnu_cxx13new
    _allocatorISsE10deallocateEPSsj[__gnu_cxx::new_allocator<std::basic_string<char,
     std::char_traits<char>, std::allocator<char> > >::deallocate(std::basic_string<
    char, std::char_traits<char>, std::allocator<char> >*, unsigned int)]+0xd): unde
    fined reference to `operator delete(void*)'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt10_ConstructIS
    sSsEvPT_RKT0_[void std::_Construct<std::basic_string<char, std::char_traits<char
    >, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::
    allocator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocat
    or<char> >*, std::basic_string<char, std::char_traits<char>, std::allocator<char
    > > const&)]+0xc): undefined reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt10_ConstructIS
    sSsEvPT_RKT0_[void std::_Construct<std::basic_string<char, std::char_traits<char
    >, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::
    allocator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocat
    or<char> >*, std::basic_string<char, std::char_traits<char>, std::allocator<char
    > > const&)]+0x66): undefined reference to `std::basic_string<char, std::char_tr
    aits<char>, std::allocator<char> >::basic_string(std::string const&)'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt8_DestroyISsEv
    PT_[void std::_Destroy<std::basic_string<char, std::char_traits<char>, std::allo
    cator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocator<c
    har> >*)]+0xd): undefined reference to `std::basic_string<char, std::char_traits
    <char>, std::allocator<char> >::~basic_string()'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZN9__gnu_cxx13new
    _allocatorISt6vectorISsSaISsEEE8allocateEjPKv[__gnu_cxx::new_allocator<std::vect
    or<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::
    allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >
     > > >::allocate(unsigned int, void const*)]+0x16): undefined reference to `oper
    ator new(unsigned int)'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZN9__gnu_cxx13new
    _allocatorISt6vectorISsSaISsEEE10deallocateEPS3_j[__gnu_cxx::new_allocator<std::
    vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, s
    td::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<cha
    r> > > > >::deallocate(std::vector<std::basic_string<char, std::char_traits<char
    >, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_trai
    ts<char>, std::allocator<char> > > >*, unsigned int)]+0xd): undefined reference
    to `operator delete(void*)'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt10_ConstructIS
    t6vectorISsSaISsEES2_EvPT_RKT0_[void std::_Construct<std::vector<std::basic_stri
    ng<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::bas
    ic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::all
    ocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
    > >(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<c
    har> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allo
    cator<char> > > >*, std::vector<std::basic_string<char, std::char_traits<char>,
    std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<
    char>, std::allocator<char> > > > const&)]+0xc): undefined reference to `__gxx_p
    ersonality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZNSt6vectorISsSaI
    SsEEC1ERKS1_[std::vector<std::basic_string<char, std::char_traits<char>, std::al
    locator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>,
    std::allocator<char> > > >::vector(std::vector<std::basic_string<char, std::char
    _traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, st
    d::char_traits<char>, std::allocator<char> > > > const&)]+0xc): undefined refere
    nce to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt24__uninitiali
    zed_copy_auxIN9__gnu_cxx17__normal_iteratorIPKSsSt6vectorISsSaISsEEEEPSsET0_T_SA
    _S9_12__false_type[std::basic_string<char, std::char_traits<char>, std::allocato
    r<char> >* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<std::basic
    _string<char, std::char_traits<char>, std::allocator<char> > const*, std::vector
    <std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::al
    locator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
     > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(_
    _gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std:
    :allocator<char> > const*, std::vector<std::basic_string<char, std::char_traits<
    char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_
    traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::ba
    sic_string<char, std::char_traits<char>, std::allocator<char> > const*, std::vec
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std:
    :allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>
    > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*
    , __false_type)]+0xc): undefined reference to `__gxx_personality_sj0'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt24__uninitiali
    zed_copy_auxIN9__gnu_cxx17__normal_iteratorIPKSsSt6vectorISsSaISsEEEEPSsET0_T_SA
    _S9_12__false_type[std::basic_string<char, std::char_traits<char>, std::allocato
    r<char> >* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<std::basic
    _string<char, std::char_traits<char>, std::allocator<char> > const*, std::vector
    <std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::al
    locator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
     > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(_
    _gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std:
    :allocator<char> > const*, std::vector<std::basic_string<char, std::char_traits<
    char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_
    traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::ba
    sic_string<char, std::char_traits<char>, std::allocator<char> > const*, std::vec
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std:
    :allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>
    > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*
    , __false_type)]+0x94): undefined reference to `__cxa_begin_catch'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt24__uninitiali
    zed_copy_auxIN9__gnu_cxx17__normal_iteratorIPKSsSt6vectorISsSaISsEEEEPSsET0_T_SA
    _S9_12__false_type[std::basic_string<char, std::char_traits<char>, std::allocato
    r<char> >* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<std::basic
    _string<char, std::char_traits<char>, std::allocator<char> > const*, std::vector
    <std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::al
    locator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
     > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(_
    _gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std:
    :allocator<char> > const*, std::vector<std::basic_string<char, std::char_traits<
    char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_
    traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::ba
    sic_string<char, std::char_traits<char>, std::allocator<char> > const*, std::vec
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std:
    :allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>
    > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*
    , __false_type)]+0xb2): undefined reference to `__cxa_rethrow'
    C:\DOCUME~1\COLIND~1\LOCALS~1\Temp/ccAjO7DS.o:Test.cpp:(.text$_ZSt24__uninitiali
    zed_copy_auxIN9__gnu_cxx17__normal_iteratorIPKSsSt6vectorISsSaISsEEEEPSsET0_T_SA
    _S9_12__false_type[std::basic_string<char, std::char_traits<char>, std::allocato
    r<char> >* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<std::basic
    _string<char, std::char_traits<char>, std::allocator<char> > const*, std::vector
    <std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::al
    locator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
     > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(_
    _gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std:
    :allocator<char> > const*, std::vector<std::basic_string<char, std::char_traits<
    char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_
    traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::ba
    sic_string<char, std::char_traits<char>, std::allocator<char> > const*, std::vec
    tor<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std:
    :allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>
    > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*
    , __false_type)]+0xd5): undefined reference to `__cxa_end_catch'
    collect2: ld returned 1 exit status

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  8. #8
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Oh and I meant to mention that I do not get these warnings, and I just installed MinGW default settings, it gave me g++ 3.4.5

    g++ (GCC) 3.4.5 (mingw-vista special r3)

    I am on Windows XP

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    gcc is able to figure out if it's C or C++, but if you use gcc for the final step of producing the executable file, then you need to provide the C++ standard libraries yourself. If you use g++, it automatically drags in the C++ library as well as the standard C library. If you are going to use only one and not the other, I'd suggest that using g++ is a better option - it still compiles C code as well as C++ code.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #10
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    I have been using this distribution here
    MinGW Distro - nuwen.net
    for quite a while now, and I haven't seen anything wrong with it.

    Comes with GCC 4.3 and a number of common libraries.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 12:03 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21