From cstrato at aon.at  Sun Feb  4 22:47:37 2007
From: cstrato at aon.at (cstrato)
Date: Sun, 04 Feb 2007 22:47:37 +0100
Subject: [Rd] Problem using ofstream in C++ class in package for MacOS X
In-Reply-To: <m2d54pob4f.fsf@fhcrc.org>
References: <45C6315F.9020209@aon.at>	<17862.14169.654577.51179@basebud.nulle.part>	<45C6400A.3050700@aon.at>
	<m2d54pob4f.fsf@fhcrc.org>
Message-ID: <45C65479.30906@aon.at>

Seth Falcon wrote:
> cstrato <cstrato at aon.at> writes:
>   
>> Thank you for your fast answer.
>> Sorrowly, I don?t know how to use a debugger on MacOS X, I am using 
>> old-style print commands.
>>     
>
> You should be able to use gdb on OS X (works for me, YMMV).  So you
> could try:
>
>       R -d gdb
>       run
>       # source a script that causes crash
>       # back in gdb, use backtrace, etc.
>
> + seth
>
>
>   
Dear Seth

Thank you for this tip, I just tried it and here is the result:

Welcome to MyClass
 > writeFileCpp("myout_fileCpp.txt")
[1] "outfile =  myout_fileCpp.txt"
Writing file myout_fileCpp.txt using C++ style.
---MyClassA::MyClassA()---------
---MyClassA::WriteFileCpp---------

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000006
0x020fe231 in std::ostream::flush (this=0x214f178) at 
/Builds/unix/o403/i686-apple-darwin8/libstdc++-v3/include/bits/ostream.tcc:395
395     
/Builds/unix/o403/i686-apple-darwin8/libstdc++-v3/include/bits/ostream.tcc: 
No such file or directory.
        in 
/Builds/unix/o403/i686-apple-darwin8/libstdc++-v3/include/bits/ostream.tcc
(gdb)

It seems that it cannot find ostream.tcc, whatever this extension means.

Best regards
Christian



[Rd] Problem using ofstream in C++ class in package for MacOS X
cstrato