Menu

Cannot compile with STLport

Help
Zeroth
2014-08-04
2014-08-12
  • Zeroth

    Zeroth - 2014-08-04

    I'm including every library but it's still complaining about a missing stlp_std::cout

    [code]
    g++ -I /opt/stlport/include/stlport/ -L /opt/stlport/lib/ -l stlport -l stlportg -lstlportstlg test.cpp
    /tmp/cccs4V8V.o: In function main': test.cpp:(.text+0x75): undefined reference tostlp_std::cout'
    /tmp/cccs4V8V.o: In function stlp_std::_STLP_mutex_base::_M_initialize()': test.cpp:(.text._ZN8stlp_std16_STLP_mutex_base13_M_initializeEv[_ZN8stlp_std16_STLP_mutex_base13_M_initializeEv]+0x15): undefined reference topthread_spin_init'
    /tmp/cccs4V8V.o: In function stlp_std::_STLP_mutex_base::_M_destroy()': test.cpp:(.text._ZN8stlp_std16_STLP_mutex_base10_M_destroyEv[_ZN8stlp_std16_STLP_mutex_base10_M_destroyEv]+0xd): undefined reference topthread_spin_destroy'
    /tmp/cccs4V8V.o: In function stlp_std::ios_base::getloc() const': test.cpp:(.text._ZNK8stlp_std8ios_base6getlocEv[_ZNK8stlp_std8ios_base6getlocEv]+0x17): undefined reference tostlp_std::locale::locale(stlp_std::locale const&)'
    /tmp/cccs4V8V.o: In function stlp_std::ios_base::_M_check_exception_mask()': test.cpp:(.text._ZN8stlp_std8ios_base23_M_check_exception_maskEv[_ZN8stlp_std8ios_base23_M_check_exception_maskEv]+0x1f): undefined reference tostlp_std::ios_base::_M_throw_failure()'
    /tmp/cccs4V8V.o: In function stlp_std::basic_ostream<char, stlp_std::char_traits<char> >& stlp_std::priv::__put_num<char, stlp_std::char_traits<char>, long>(stlp_std::basic_ostream<char, stlp_std::char_traits<char> >&, long)': test.cpp:(.text._ZN8stlp_std4priv9__put_numIcNS_11char_traitsIcEElEERNS_13basic_ostreamIT_T0_EES8_T1_[_ZN8stlp_std4priv9__put_numIcNS_11char_traitsIcEElEERNS_13basic_ostreamIT_T0_EES8_T1_]+0xfc): undefined reference tostlp_std::locale::~locale()'
    test.cpp:(.text._ZN8stlp_std4priv9put_numIcNS_11char_traitsIcEElEERNS_13basic_ostreamIT_T0_EES8_T1_[ZN8stlp_std4priv9__put_numIcNS_11char_traitsIcEElEERNS_13basic_ostreamIT_T0_EES8_T1]+0x142): undefined reference to stlp_std::locale::~locale()' /tmp/cccs4V8V.o: In functionstlp_std::num_put<char, stlp_std::ostreambuf_iterator<char,="" stlp_std::char_traits<char=""> > > stlp_std::priv::_UseFacet<stlp_std::num_put<char, stlp_std::ostreambuf_iterator<char,="" stlp_std::char_traits<char=""> > > >(stlp_std::locale const&, stlp_std::num_put<char, stlp_std::ostreambuf_iterator<char,="" stlp_std::char_traits<char=""> > > const)':
    test.cpp:(.text.ZN8stlp_std4priv9_UseFacetINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEPT_RKNS_6localeEPKS8[ZN8stlp_std4priv9_UseFacetINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEPT_RKNS_6localeEPKS8]+0xd): undefined reference to stlp_std::priv::_GetFacetId(stlp_std::num_put<char, stlp_std::ostreambuf_iterator<char, stlp_std::char_traits<char> > > const*)' test.cpp:(.text._ZN8stlp_std4priv9_UseFacetINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEPT_RKNS_6localeEPKS8_[_ZN8stlp_std4priv9_UseFacetINS_7num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEEEEPT_RKNS_6localeEPKS8_]+0x1c): undefined reference tostlp_std::locale::_M_use_facet(stlp_std::locale::id const&) const'
    /tmp/cccs4V8V.o: In function stlp_std::allocator<int>::_M_allocate(unsigned int, unsigned int&)': test.cpp:(.text._ZN8stlp_std9allocatorIiE11_M_allocateEjRj[_ZN8stlp_std9allocatorIiE11_M_allocateEjRj]+0x60): undefined reference tostlp_std::
    malloc_alloc::allocate(unsigned int)'
    collect2: error: ld returned 1 exit status
    [/code]

     
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2014-08-04

    I'm including every library but

    The probability that 1000 monkeys with typewriters will write "War and Peace" isn't zero.

    make && (cd build/test/unit && make)

    Don't be ashamed of read compilation/link strings: they printed as is.

     
  • Zeroth

    Zeroth - 2014-08-05

    I'm not sure what your last sentence means.

    And I'm sorry but I can't figure out how to paste code here...

    But I got this:

    ~/Downloads/STLport-5.2.1/build/test/unit $ make
    c++ -pthread -fexceptions -O2 -fuse-cxa-atexit -fvisibility=hidden -I../../../stlport -c -o obj/gcc/so/iter_test.o ../../../test/unit/iter_test.cpp
    In file included from ../../../test/unit/iter_test.cpp:6:0:
    ../../../test/unit/iota.h: In instantiation of ‘void iota(_It, _It, _Tp) [with _It = int*; _Tp = int]’:
    ../../../test/unit/iter_test.cpp:114:33: required from here
    ../../../test/unit/iota.h:10:30: error: ‘iota’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    iota(
    first, last, val);
    ^
    In file included from ../../../stlport/numeric:33:0,
    from ../../../test/unit/iter_test.cpp:4:
    ../../../stlport/stl/_numeric.h:174:6: note: ‘template<class _ForwardIterator,="" class="" _Tp=""> void stlp_std::iota(_ForwardIterator, _ForwardIterator, _Tp)’ declared here, later in the translation unit
    void iota(_ForwardIterator first, _ForwardIterator last, _Tp __val) {
    ^
    make: *** [obj/gcc/so/iter_test.o] Error 1

     

    Last edit: Zeroth 2014-08-05
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2014-08-05

    [code]
    git st
    On branch STLport-5.2

    ...
    git log
    commit 6ecc702c2bc841ef197a9943b1510e23da7b6246
    Author: Kuldeep Gupta ...
    Date: Thu Jul 3 10:31:55 2014 +0400

    Fix typo: compare string with self

    ...
    commit 7c91cd634ee4be70b3f6e51b445415f370b58198
    Author: Petr Ovtchenkov ...
    Date: Fri Apr 20 20:33:20 2012 +0400

    namespace for iota

    ...
    [/code]

     

    Last edit: Petr Ovtchenkov 2014-08-05
  • Zeroth

    Zeroth - 2014-08-05

    Pasting code or git messages without any explanation for what it means is not helping me. Are you suggesting that I pull from git instead of using the latest package in the download section?

    I'm sure you're a wonderful programmer, but your people skills could use a little work ;)

     
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2014-08-06

    Pasting code or git messages without any explanation...

    "Use git's HEAD of STLport-5.2 branch, the problem you mentioned, was resolved 2.5 years ago"; if this isn't evident, then you not a programmer; if you not a programmer, why you has interest to "system" library? Make sense?

     
  • Zeroth

    Zeroth - 2014-08-06

    I'm using 5.2.1 downloaded straight from the downloads section. If this was indeed fixed over two years ago, then I think you guys might wanna take a look at what you're packaging up there.

    There's no need to be arrogant.

    For the record, I'm new to git. I'm a long-time subversion user.

    I did a git clone -b STLport-5.1 git://git.code.sf.net/p/stlport/code stlport-code

    Update: compiled and did make install and all that, it installed stl_unit_test though, which I ran... and it segfaults. Presumably some unit test is failing (I've omitted the successful tests at the beginning):

    FstreamTest::output

    ../../../test/unit/fstream_test.cpp(101) : CPPUNIT_ASSERT(f.good());
    FstreamTest::input

    ../../../test/unit/fstream_test.cpp(111) : CPPUNIT_ASSERT(f.good());
    FstreamTest::input_char

    ../../../test/unit/fstream_test.cpp(150) : CPPUNIT_ASSERT(buf[0] == '1');
    FstreamTest::io

    ../../../test/unit/fstream_test.cpp(159) : CPPUNIT_ASSERT(f.is_open());
    FstreamTest::err

    ../../../test/unit/fstream_test.cpp(194) : CPPUNIT_ASSERT(f.is_open());
    FstreamTest::tellg

    ../../../test/unit/fstream_test.cpp(215) : CPPUNIT_ASSERT(of.is_open());
    FstreamTest::tellp

    ../../../test/unit/fstream_test.cpp(281) : CPPUNIT_CHECK(o.rdbuf()->pubseekoff( 0, ios_base::cur, ios_base::out ) == ofstream::pos_type(6));

    ../../../test/unit/fstream_test.cpp(282) : CPPUNIT_CHECK(o.tellp() == ofstream::pos_type(6));

    ../../../test/unit/fstream_test.cpp(289) : CPPUNIT_CHECK(o.rdbuf()->pubseekoff( 0, ios_base::cur, ios_base::out ) == ofstream::pos_type(9));

    ../../../test/unit/fstream_test.cpp(290) : CPPUNIT_CHECK(o.tellp() == ofstream::pos_type(9));

    ../../../test/unit/fstream_test.cpp(321) : CPPUNIT_CHECK(o.rdbuf()->pubseekoff( 0, ios_base::cur, ios_base::out ) == ofstream::pos_type(expected_pos));

    Segmentation fault

     

    Last edit: Zeroth 2014-08-06
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2014-08-07

    I'm using 5.2.1 downloaded straight from the downloads section ...

    No more tarballs will be ship out. Use code from git.

    By the way, git head doesn't even compile.

    Public repos has at least 4 heads. What you mean?

     
  • Zeroth

    Zeroth - 2014-08-07

    I was mistaken, I was using the wrong branch.

    I am currently using the correct STLport-5.2 branch, but I am having the same issue as before. It complains about a missing stlp_std::cout.

    Also, stl_unit_test segfaults.

     
  • Darko Miletic

    Darko Miletic - 2014-08-07

    It appears to be something with your distribution. I just tried following on Centos 5.5 32bit:

        git clone git://git.code.sf.net/p/stlport/code stlport-code
        cd stlport-code
        git checkout -b STLport-5.2 origin/STLport-5.2
        ./configure
        make && (cd build/test/unit && make)
    

    And no problems whatsoever. So in order to get some help you should provide:
    Distribution you use (exact version number)
    gcc version

    etc.

    Also if it turns out your distribution is not supported (being too recent) do you really need stlport? What is wrong with libstdc++?

     
  • Zeroth

    Zeroth - 2014-08-12

    I'm on Linux Mint 16 Petra, i686 single-core

    It's a sort of old machine but the distro is fairly recent.

    I'm mostly interested in STLport's debug features that I've read about. (Also, isn't the purpose of STLport to be more portable than libraries such as libstdc++?)

     
  • Darko Miletic

    Darko Miletic - 2014-08-12

    This is open source project. People dedicate their time to it as they see fit. There are no guarantees of any kind. Portability is an ideal that needs to be maintained. So if making this work on your distribution is important to you - you should analyze the issue and provide the fix. Nobody else will care - to be blunt.

     

Log in to post a comment.