Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Code Warrior > static member v...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 445 of 537
Post > Topic >>

static member variable init fialure on Mac OS 10.3.9 and CodeWarrior 9.5

by yhb1@[EMAIL PROTECTED] May 20, 2005 at 01:37 PM

The Mach-O application works fine before I upgrade to 10.3.9 and CW
9.5, and I notice the break after recompiled the header and library.

I had tried to reinstall CW 9.0 and only upgrade to 9.4 where it works
before, but the error still exists. I also removed
USER/Library/Preferences/Metrowerks folder before reinstall CW90, as
somebody suggested on board.

Is there anywhere else caching libraries or object files?

The compiling and linking have no problem, debugging run into "access
fault exception" error. The calling stack window shows:
  1. start
  2. start
  3. start
  4. dyld 0x8FE142A4
  5. dyld 0x8FE17178
  6. dyld 0x8FE176B0
  7. __sinit_/MyCppFileWhichContainAStaticMemberVariable_cpp
  8. std::_nInit::__nInit()
  9 Metrowerks::bufferedbug<char, std::char_traits<char>
>::setbug(char*, int)
  10. Metrowerks::bufferedbug<char, std::char_traits<char>
>::seekpos(std::fpos<int>, std::ios_base::openmode)
  11. Metrowerks::bufferedbug<char, std::char_traits<char> >::is_open()
const

__nInit::__nInit()
{
	Metrowerks::mutex::scoped_lock lock(get_stream_init_mutex());
	static Metrowerks::console_inputbuf<char> fin(stdin);
	static Metrowerks::console_outputbuf<char> fout(stdout);
	static Metrowerks::console_outputbuf<char> ferr(stderr);

	if (ninit_cnt_s++ == 0)
	{
		new (&cin)istream(&fin);
		new (&cout)ostream(&fout);
		new (&cerr)ostream(&ferr);
		new (&clog)ostream(&ferr);
		cin.tie(&cout);
		cerr.setf(ios_base::unitbuf);

		fin.pubsetbuf(0, 0);
		fout.pubsetbuf(0, 0); // Note: linker call bufferedbuf::setbug(), but
this pointer of bufferedbuf is 0
		ferr.pubsetbuf(0, 0);
	}
}

Thanks,
Henry
 




 3 Posts in Topic:
static member variable init fialure on Mac OS 10.3.9 and CodeWar
yhb1@[EMAIL PROTECTED]   2005-05-20 13:37:06 
Re: static member variable init fialure on Mac OS 10.3.9 and Cod
MW Ron <mwron@[EMAIL P  2005-05-22 14:55:03 
Re: static member variable init fialure on Mac OS 10.3.9 and Cod
Howard Hinnant <hinnan  2005-05-22 21:47:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 21:14:28 CDT 2008.