• 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
C++ Compiler Mystery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ Compiler Mystery


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

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


 ...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

  • Follow-Ups:
    • Re: C++ Compiler Mystery
      • From: "Duane Murphy" <email@hidden>
  • Prev by Date: Re: <Multiple values> value of some build setting
  • Next by Date: Re: Seeking advice on debugging "real time" programs.
  • Previous by thread: Re: <Multiple values> value of some build setting
  • Next by thread: Re: C++ Compiler Mystery
  • Index(es):
    • Date
    • Thread