• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++ Compiler Mystery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Compiler Mystery


  • Subject: Re: C++ Compiler Mystery
  • From: "Duane Murphy" <email@hidden>
  • Date: Wed, 12 Apr 2006 23:28:08 -0700

A little more digging and I was able to find it.

It was related to using flex. FlexLexer.h includes old C++ header files
(particularly in the 10.2.8 SDK). By including <iostream> before
including FlexLexer.h, I was able to remove the extraneous _cerr and
_clog symbols.

On to the next linker problems <sigh>

 ...Duane

--- At Wed, 12 Apr 2006 16:24:28 -0700, Duane Murphy wrote:

>I'm new to the list, I hope this question is appropriate for here.
>
>I am in the process of porting some code from CodeWarrior to Xcode. Of
>course all of this code worked in CodeWarrior. :-)
>
>My mystery begins with satisfying some linker errors. Mysteriously
>appearing in the list of unresolved symbols is _cerr and _clog. But
>wait. Those are C++ symbols and should be mangled. They should more
>correctly be __ZSt4cerr and __ZSt4clog.
>
>Some how these symbols have been "promoted" to C.
>
>I ran nm on all of the .o files and discovered that this only in
>compiling one file. Unfortunately the file is a tad complex and includes
>many files (including an Flex lexer).
>
>I preprocessed the file to see if anything was obvious.
>  - Every reference to cerr and clog is preceeded with std:: except for
>the definition in iostreams where it is in the std namespace.
>  - I could find no unbalanced extern "C" declarations.
>
>As an additional check, I added a use of cout to the same code file.
>Sure enough cout now shows up as _cout.
>
>This is a strange mystery that I hope someone can shed some light on.
>
>Thanks for any tips, pointers, or ideas for determining how this has
>happened.

 ...Duane

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >C++ Compiler Mystery (From: "Duane Murphy" <email@hidden>)

  • Prev by Date: I think I weaseled out or my thread problem.
  • Next by Date: Results of timing test.
  • Previous by thread: C++ Compiler Mystery
  • Next by thread: I think I weaseled out or my thread problem.
  • Index(es):
    • Date
    • Thread