Menu

Compiling version 1.9.07 failed

2013-03-28
2013-04-03
  • Juan J. Lopez Villarejo

    System: MacOsX 10.6.8
    gcc compiler: i686-apple-darwin10-gcc-4.2.1: no input files

    PROCEDURE:
    - Downloaded Src_xml2abc_2013_03_26.zip and unpacked
    - Downloaded boost_1_53_0.tar.gz and unpacked. Then, placed the folder inside the src_Moritz2 directory.

    run the gcc compiler:
    gcc diverse/cpp/.cpp Moritz2/cpp/.cpp MuLanPa/cpp/.cpp MuLanPa/process/cpp/.cpp tool_xml/.cpp tinyxml/.cpp -Idiverse/h -IMoritz2/h -IMuLanPa/h -IMuLanPa/process/h -Itool_xml -Itinyxml -Iboost_1_53_0 -D TIXML_USE_STL -o a.out

    *Note: using "-D NO_SYSTEM_FOR_FOLDERCREATE" is not compatible with Mac
    using "-D SYSTEM_FOR_FOLDERCREATE" seems to give the same errors.

    OUTPUT: begins with

    Undefined symbols:
    "std::_List_node_base::unhook()", referenced from:
    std::list<std::basic_string<char, std::char_traits<char="">, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char="">, std::allocator<char> > > >::_M_erase(std::_List_iterator<std::basic_string<char, std::char_traits<char="">, std::allocator<char> > >)in ccZGlK7x.o
    std::list<std::basic_string<char, std::char_traits<char="">, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char="">, std::allocator<char> > > >::_M_erase(std::_List_iterator<std::basic_string<char, std::char_traits<char="">, std::allocator<char> > >)in cchxaxUH.o
    std::list<boost::spirit::classic::tree_match<char const*,="" boost::spirit::classic::node_iter_data_factory<char="">, boost::spirit::classic::nil_t>, std::allocator<boost::spirit::classic::tree_match<char const*,="" boost::spirit::classic::node_iter_data_factory<char="">, boost::spirit::classic::nil_t> > >::_M_erase(std::_List_iterator<boost::spirit::classic::tree_match<char const*,="" boost::spirit::classic::node_iter_data_factory<char="">, boost::spirit::classic::nil_t> >)in ccOtGcB8.o

     
    • Juan J. Lopez Villarejo

      It was all my fault.

      Just replaced gcc --> g++

      Post is solved. Should I do next time in "bugs &requests" section?

       
  • Eckard Klotz

    Eckard Klotz - 2013-04-03

    Hello Juan.

    I tried to build Moritz 2 with "gcc" instead of "g++" also and I've got a similar result, a lot of "undefined reference to ..."

    Than I searched a little bit in the mailing-list "SourceForge.net: MinGW - Minimalist GNU for Windows". This is one of the 2 gnu-compiler distributions for windows (the other one is cyg-win). Here I found a mail-worm "[Mingw-users] Undefined references when linking with mingw32-gcc"(I have added the last reply).

    The take-home-messages are:
    1. You can use "gcc" to compile the sources but you have to use "g++" to link the object-files.
    2. On the other side you can use "g++" also to compile the cpp-sources.

    Best regards,
    Eckard.


    Email Archive: mingw-users (read-only) Re: [Mingw-users] Undefined references when linking with mingw32-gcc
    From: Earnie earnie@us... - 2011-12-18 15:20 I've read all the posts but choose to answer the original mail.

    First I will say DO NOT TOP POST.
    Second, trim the parts of the quoted mail you're not responding to.

    More below

    Sultan Saini wrote:

    Hello,

    I'm trying to build a small jni dll with mingw gcc and am having trouble
    during the linking step of the build.
    The linker command is thus:
    /c/MinGW/bin/mingw32-gcc.exe -w -fPIC -lstdc++ -shared -mwindows
    -LC:/MinGW/lib/glut -LC:/MinGW/lib/GLU -LC:/MinGW/lib/GL -lm
    -LC:/MinGW/lib/glib-2.0 -lopengl32 -lglu32 -lglut32 -lglib-2.0
    build/gl2ps.o build/gl2psjni.o build/mathml2ps.o -o build/gl2psjni.dll

    1) Command line order matters for the library specification. Libraries to resolve references in objects must follow the object specification and not precede it.
    2) For C++ code you do to use G++ and not GCC for the link step.
    3) Do not include the standard libraries like libstdc++ in the link step.
    4) -lm is meaningless.

    http://www.mingw.org/wiki
    http://www.mingw.org/wiki/FAQ
    http://www.mingw.org/wiki/HOWTO

    -- Earnie -- https://sites.google.com/site/earnieboyd/

     

    Last edit: Eckard Klotz 2013-04-03

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.