C++ Compiler Mystery
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