C++ compiler errors (OS X, QT)

Discussion in 'C++' started by tkietzma@googlemail.com, Nov 27, 2007.

  1. Guest

    Hello world,

    I have some code, which happily runs on Ubuntu. Now, I have to port
    this code to OS X. However, on compiling I get (hundreds of) errors
    like:

    /usr/include/c++/4.0.0/bits/localefwd.h:124: error: 'mbstate_t' was
    not declared in this scope
    /usr/include/c++/4.0.0/bits/localefwd.h:124: error: template argument
    3 is invalid
    /usr/include/c++/4.0.0/bits/localefwd.h:126: error: 'mbstate_t' was
    not declared in this scope
    /usr/include/c++/4.0.0/bits/localefwd.h:126: error: template argument
    3 is invalid
    /usr/include/c++/4.0.0/bits/localefwd.h:132: error: expected `>'
    before 'istreambuf_iterator'
    /usr/include/c++/4.0.0/bits/localefwd.h:132: error: expected
    unqualified-id before '>' token
    ......

    I am using a (qmake generated) Makefile, with the following call for
    each cpp-file:

    c++ -c -pipe -Wno-deprecated -I/sw/include -g3 -D_REENTRANT -
    D_GNU_SOURCE -fPIC -DNDEBUG -g -g -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -
    DQT_SHARED -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I/usr/
    local/Trolltech/Qt-4.3.2/lib/QtCore.framework/Versions/4/Headers -I/
    usr/local/Trolltech/Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/
    Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/Qt-4.3.2/lib/
    QtGui.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.3.2/
    include/QtGui -I/usr/local/Trolltech/Qt-4.3.2/include/QtGui -I/usr/
    local/Trolltech/Qt-4.3.2/include -I. -Iexternal -IFILOU -I. -I. -F/usr/
    local/Trolltech/Qt-4.3.2/lib -o objects/iGRLVQ_Demo.o iGRLVQ_Demo.cpp

    Any suggestions? This is (unfortunately) somewhat urgent because I
    have to give a talk and a deadline on this on Thursday and would like
    to use os x for it. It should be pretty easy (I hope)..

    Greetings and thanks so much in advance, any help is appreciated.
    Tim
     
    , Nov 27, 2007
    #1
    1. Advertising

  2. wrote:

    > I have some code, which happily runs on Ubuntu. Now, I have to port
    > this code to OS X. However, on compiling I get (hundreds of) errors
    > like:


    [Off Topic here but...]

    Do you include wchar.h?
     
    Matthias Buelow, Nov 27, 2007
    #2
    1. Advertising

  3. wrote:
    > I have some code, which happily runs on Ubuntu. Now, I have to port
    > this code to OS X. However, on compiling I get (hundreds of) errors
    > like:
    >
    > /usr/include/c++/4.0.0/bits/localefwd.h:124: error: 'mbstate_t' was
    > not declared in this scope


    Seems like 'mbstate_t' is undeclared... Are you sure your compiler
    and library were correctly installed?

    > /usr/include/c++/4.0.0/bits/localefwd.h:124: error: template argument
    > 3 is invalid
    > /usr/include/c++/4.0.0/bits/localefwd.h:126: error: 'mbstate_t' was
    > not declared in this scope
    > /usr/include/c++/4.0.0/bits/localefwd.h:126: error: template argument
    > 3 is invalid
    > /usr/include/c++/4.0.0/bits/localefwd.h:132: error: expected `>'
    > before 'istreambuf_iterator'
    > /usr/include/c++/4.0.0/bits/localefwd.h:132: error: expected
    > unqualified-id before '>' token
    > .....
    >
    > I am using a (qmake generated) Makefile, with the following call for
    > each cpp-file:
    >
    > c++ -c -pipe -Wno-deprecated -I/sw/include -g3 -D_REENTRANT -
    > D_GNU_SOURCE -fPIC -DNDEBUG -g -g -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB
    > - DQT_SHARED -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I.
    > -I/usr/
    > local/Trolltech/Qt-4.3.2/lib/QtCore.framework/Versions/4/Headers -I/
    > usr/local/Trolltech/Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/
    > Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/Qt-4.3.2/lib/
    > QtGui.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.3.2/
    > include/QtGui -I/usr/local/Trolltech/Qt-4.3.2/include/QtGui -I/usr/
    > local/Trolltech/Qt-4.3.2/include -I. -Iexternal -IFILOU -I. -I.
    > -F/usr/ local/Trolltech/Qt-4.3.2/lib -o objects/iGRLVQ_Demo.o
    > iGRLVQ_Demo.cpp
    >
    > Any suggestions? This is (unfortunately) somewhat urgent because I
    > have to give a talk and a deadline on this on Thursday and would like
    > to use os x for it. It should be pretty easy (I hope)..


    Suggestion: Switch to Ubuntu for your talk. Without seeing the code
    all I can recommend is to ask in OS X newsgroup.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Nov 27, 2007
    #3
  4. Guest

    Hi,

    I don't include wchar.h or anything the like, but I include
    <iostream>. I would love to switch to ubuntu for the talk, but the
    slides are made by keynote and (even worse), I can't get my Ubuntu to
    work with external monitors..

    Here is what I get when checking c++

    c++ -v
    Using built-in specs.
    Target: powerpc-apple-darwin9
    Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-
    checking -enable-werror --prefix=/usr --mandir=/share/man --enable-
    languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/
    $/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/
    lib --build=i686-apple-darwin9 --program-prefix= --host=powerpc-apple-
    darwin9 --target=powerpc-apple-darwin9
    Thread model: posix
    gcc version 4.0.1 (Apple Inc. build 5465)

    Does this help?

    Thanks a lot.
    Tim


    On Nov 27, 6:46 pm, "Victor Bazarov" <> wrote:
    > wrote:
    > > I have some code, which happily runs on Ubuntu. Now, I have to port
    > > this code to OS X. However, on compiling I get (hundreds of) errors
    > > like:

    >
    > > /usr/include/c++/4.0.0/bits/localefwd.h:124: error: 'mbstate_t' was
    > > not declared in this scope

    >
    > Seems like 'mbstate_t' is undeclared... Are you sure your compiler
    > and library were correctly installed?
    >
    >
    >
    > > /usr/include/c++/4.0.0/bits/localefwd.h:124: error: template argument
    > > 3 is invalid
    > > /usr/include/c++/4.0.0/bits/localefwd.h:126: error: 'mbstate_t' was
    > > not declared in this scope
    > > /usr/include/c++/4.0.0/bits/localefwd.h:126: error: template argument
    > > 3 is invalid
    > > /usr/include/c++/4.0.0/bits/localefwd.h:132: error: expected `>'
    > > before 'istreambuf_iterator'
    > > /usr/include/c++/4.0.0/bits/localefwd.h:132: error: expected
    > > unqualified-id before '>' token
    > > .....

    >
    > > I am using a (qmake generated) Makefile, with the following call for
    > > each cpp-file:

    >
    > > c++ -c -pipe -Wno-deprecated -I/sw/include -g3 -D_REENTRANT -
    > > D_GNU_SOURCE -fPIC -DNDEBUG -g -g -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB
    > > - DQT_SHARED -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I.
    > > -I/usr/
    > > local/Trolltech/Qt-4.3.2/lib/QtCore.framework/Versions/4/Headers -I/
    > > usr/local/Trolltech/Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/
    > > Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/Qt-4.3.2/lib/
    > > QtGui.framework/Versions/4/Headers -I/usr/local/Trolltech/Qt-4.3.2/
    > > include/QtGui -I/usr/local/Trolltech/Qt-4.3.2/include/QtGui -I/usr/
    > > local/Trolltech/Qt-4.3.2/include -I. -Iexternal -IFILOU -I. -I.
    > > -F/usr/ local/Trolltech/Qt-4.3.2/lib -o objects/iGRLVQ_Demo.o
    > > iGRLVQ_Demo.cpp

    >
    > > Any suggestions? This is (unfortunately) somewhat urgent because I
    > > have to give a talk and a deadline on this on Thursday and would like
    > > to use os x for it. It should be pretty easy (I hope)..

    >
    > Suggestion: Switch to Ubuntu for your talk. Without seeing the code
    > all I can recommend is to ask in OS X newsgroup.
    >
    > V
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask
     
    , Nov 27, 2007
    #4
  5. Matthias Buelow, Nov 27, 2007
    #5
  6. Guest

    On Nov 27, 6:52 pm, Matthias Buelow <> wrote:
    > wrote:
    > > I don't include wchar.h or anything the like, but I include

    >
    > Why not?
    >
    > See wcstrtomb(3) on your local machine or viahttp://developer.apple.com/documentation/Darwin/Reference/ManPages/ma...
    >
    > And learn to use Google.

    Oh, what a good idea, I did not think of checking an Internet search
    machine like google. Please, if I would not have spent the whole day
    searching and not finding anything, I would not have asked...

    To be honest, I still don't see why including this file should help? I
    get hundreds of errors, not only for string commands,etc

    T
     
    , Nov 27, 2007
    #6
  7. wrote:
    > On Nov 27, 6:52 pm, Matthias Buelow <> wrote:
    >> wrote:
    >>> I don't include wchar.h or anything the like, but I include

    >>
    >> Why not?
    >>
    >> See wcstrtomb(3) on your local machine or
    >> viahttp://developer.apple.com/documentation/Darwin/Reference/ManPages/ma...
    >>
    >> And learn to use Google.

    > Oh, what a good idea, I did not think of checking an Internet search
    > machine like google. Please, if I would not have spent the whole day
    > searching and not finding anything, I would not have asked...
    >
    > To be honest, I still don't see why including this file should help? I
    > get hundreds of errors, not only for string commands,etc


    You are frustrated. You choose the last day to move onto a new setup
    and it didn't work. Murphy's law. There are two ways out of here:
    back (which you claim doesn't work) or forward (which you are trying
    to explore, yet for some reason haven't done what's suggested). You
    _could_ try to combine the two and present using 'vmware' running your
    Ubuntu program on a virtual machine running on OS X... Or vice versa.
    Or bring two machines and switch between them. Find somebody who will
    assist you.

    But here is the kicker: How is this all relevant to C++? You cannot
    make your apparently non-portable program, which worked OK on Linux,
    compile on OS X. We sympathise but how do you think we could help
    you if you don't even post the damn code? This is a C++ *language*
    newsgroup FCOL, not OS X, not Linux, not even GCC. Each major OS and
    each major compiler have their own newsgroups. As much as I am sorry
    to tell you this, you're in a wrong place. Find the proper place to
    bother *real people* if you cannot bother yourself to find the needed
    information using machines only (Google).

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Nov 27, 2007
    #7
  8. Jim Langston Guest

    <> wrote in message
    news:...
    > On Nov 27, 6:52 pm, Matthias Buelow <> wrote:
    >> wrote:
    >> > I don't include wchar.h or anything the like, but I include

    >>
    >> Why not?
    >>
    >> See wcstrtomb(3) on your local machine or
    >> viahttp://developer.apple.com/documentation/Darwin/Reference/ManPages/ma...
    >>
    >> And learn to use Google.

    > Oh, what a good idea, I did not think of checking an Internet search
    > machine like google. Please, if I would not have spent the whole day
    > searching and not finding anything, I would not have asked...
    >
    > To be honest, I still don't see why including this file should help? I
    > get hundreds of errors, not only for string commands,etc


    Why don't you include it and see if it helps? You asked for help, someone
    gave a suggestion. Try it. If it doesn't work, then come back and say it
    didn't work.
     
    Jim Langston, Nov 27, 2007
    #8
  9. Guest

    On Nov 27, 7:20 pm, "Victor Bazarov" <> wrote:
    > wrote:
    > > On Nov 27, 6:52 pm, Matthias Buelow <> wrote:
    > >> wrote:
    > >>> I don't include wchar.h or anything the like, but I include

    >
    > >> Why not?

    >
    > >> See wcstrtomb(3) on your local machine or
    > >> viahttp://developer.apple.com/documentation/Darwin/Reference/ManPages/ma...

    >
    > >> And learn to use Google.

    > > Oh, what a good idea, I did not think of checking an Internet search
    > > machine like google. Please, if I would not have spent the whole day
    > > searching and not finding anything, I would not have asked...

    >
    > > To be honest, I still don't see why including this file should help? I
    > > get hundreds of errors, not only for string commands,etc

    >
    > You are frustrated. You choose the last day to move onto a new setup
    > and it didn't work. Murphy's law.

    Well, this is not really about frustration, but about getting
    reasonable help. "Google it" is apparently the first thing I have been
    doing for the whole day. I just don't like being treated as stupid.

    > There are two ways out of here:
    > back (which you claim doesn't work) or forward (which you are trying
    > to explore, yet for some reason haven't done what's suggested).


    I have tried to include wchar.h, but as expected, it did not solve the
    problem.

    > You
    > _could_ try to combine the two and present using 'vmware' running your
    > Ubuntu program on a virtual machine running on OS X... Or vice versa.
    > Or bring two machines and switch between them. Find somebody who will
    > assist you.


    I will use two laptops, but this is not the topic here. I wanted to
    find a way of letting c++ find the standard libraries, which seems to
    go wrong at the moment..

    >
    > But here is the kicker: How is this all relevant to C++? You cannot
    > make your apparently non-portable program, which worked OK on Linux,
    > compile on OS X. We sympathise but how do you think we could help
    > you if you don't even post the damn code?


    The _damn_ code producing the errors is a simple #include <iostream>
    as stated above.

    > This is a C++ *language*
    > newsgroup FCOL, not OS X, not Linux, not even GCC. Each major OS and
    > each major compiler have their own newsgroups. As much as I am sorry
    > to tell you this, you're in a wrong place.
    > Find the proper place to
    > bother *real people* if you cannot bother yourself to find the needed
    > information using machines only (Google).


    Sorry for _bothering_, I was hoping to find help in this group,
    because it is a c++ setup problem.

    >
    > V

    T
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask
     
    , Nov 27, 2007
    #9
  10. Guest

    On Nov 27, 9:24 pm, "Jim Langston" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On Nov 27, 6:52 pm, Matthias Buelow <> wrote:
    > >> wrote:
    > >> > I don't include wchar.h or anything the like, but I include

    >
    > >> Why not?

    >
    > >> See wcstrtomb(3) on your local machine or
    > >> viahttp://developer.apple.com/documentation/Darwin/Reference/ManPages/ma...

    >
    > >> And learn to use Google.

    > > Oh, what a good idea, I did not think of checking an Internet search
    > > machine like google. Please, if I would not have spent the whole day
    > > searching and not finding anything, I would not have asked...

    >
    > > To be honest, I still don't see why including this file should help? I
    > > get hundreds of errors, not only for string commands,etc

    >
    > Why don't you include it and see if it helps? You asked for help, someone
    > gave a suggestion. Try it. If it doesn't work, then come back and say it
    > didn't work.


    I tried including it, but as I mentioned before, this is not only
    about strings but many different standard-c++ elements. So I thought
    there might be a different problem here with local variables setups
    being wrong or thelike

    Thanks for your help anyway.
    T
     
    , Nov 27, 2007
    #10
  11. Matthias Buelow, Nov 28, 2007
    #11
  12. Silversurfer Guest

    Just to quickly give the solution: Naturally it was _not_ about
    including all standard headers of C++ but there was something
    different going wrong. In a related package, there was a file called
    "time.h" which lead the compiler to look for all standard headers in
    the same directory. Renaming and recompiling solved the issue.

    Thanks for your help

    On Nov 28 2007, 10:21 am, Matthias Buelow <> wrote:
    > wrote:
    > > Sorry for _bothering_, I was hoping to find help in this group,
    > > because it is a c++ setup problem.

    >
    > http://www.catb.org/~esr/faqs/smart-questions.html
     
    Silversurfer, Jan 21, 2008
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    985
    Mark Goldin
    Jan 17, 2004
  2. SenthilVel
    Replies:
    0
    Views:
    961
    SenthilVel
    Jun 7, 2006
  3. George1776

    Out-of-memory errors and caching errors.

    George1776, Aug 28, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,316
    George1776
    Sep 14, 2006
  4. Lance Wynn
    Replies:
    1
    Views:
    1,876
    Lance Wynn
    Feb 3, 2008
  5. yawnmoth
    Replies:
    97
    Views:
    4,758
    Bent C Dalager
    Feb 27, 2009
Loading...

Share This Page