Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Can't Build -- Receive Error "undefined reference to std::basic_ostream"
Forum Updated to NodeBB v4.3 + New Features

Can't Build -- Receive Error "undefined reference to std::basic_ostream"

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 2 Posters 4.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    orleans704
    wrote on 9 Oct 2012, 19:19 last edited by
    #1

    Hello. I'm trying to built Qt 4.8.3 under RedHat RHEL 5.8 (libc 2.5) with g++ versions 4.4.6 and 4.1.2. I use a simple configure (with and without -fast) and gmake only to get this undefined reference when linking.

    @gmake[2]: Entering directory qt-everywhere-opensource-src-4.8.3/tools/qmlplugindump' ... g++ -Wl,-rpath-link,/u/US_SCRATCH3/cots/qt-everywhere-opensource-src-4.8.3/lib -m64 -Wl,-O1 -Wl,-rpath,/app/unsupported/qt-4.8.3/lib -Wl,-rpath,/app/unsupported/qt-4.8.3/lib -o ../../bin/qmlplugindump .obj/release-shared/main.o .obj/release-shared/qmlstreamwriter.o -L/u/US_SCRATCH3/cots/qt-everywhere-opensource-src-4.8.3/lib -lQtDeclarative -L/u/US_SCRATCH3/cots/qt-everywhere-opensource-src-4.8.3/lib -lQtScript -lQtSvg -L/usr/X11R6/lib64 -lQtSql -lQtXmlPatterns -lQtNetwork -lQtGui -lQtCore -lpthread .obj/release-shared/main.o: In function main':
    main.cpp:(.text+0x448a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
    collect2: ld returned 1 exit status@

    Thanks,
    Chris

    1 Reply Last reply
    0
    • O Offline
      O Offline
      orleans704
      wrote on 10 Oct 2012, 22:01 last edited by
      #2

      This is very strange. If I manually cd into the directory and issue the g++ myself, it will compile. I have to do this over and over with different files in different directories, but it appears to be working. Why?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gouedard
        wrote on 16 Apr 2013, 11:40 last edited by
        #3

        Hello.
        I met the same "undefined reference to `std::basic_ostream<char ..."
        with qt-everywhere-opensource-src-4.8.2, at same point, qmlplugindump, and many others, as Chris.

        In my case, this was due to coexistence of g++44 and default g++ (4.1.2) on our platform
        Making C++='g++44' and CC='gcc44' was not enought, as LINK keeps "g++" from mkspecs/common/g++-base.conf.
        In short, I had to change gcc/g++ by gcc44/g++44 in g++-base.conf itself.

        Hope this helps, even late!
        Cheers,
        Claude

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved