Dirk Luesebrink (crux++at++artcom.de)
Tue, 02 Dec 1997 16:12:37 +0100
dirk
Prakash Mahesh wrote:
>
> Gordon Tomlinson wrote:
> >
> > Hi Guys
> >
> > We are experiencing problems with using iostreams and performer.
> >
> > ie simple cout cause a segmentation fault
> >
> > My colleague remmebers some postings on the issue some time agom some thing about
> > the default constructor not being called but we cannot find references in the archives.
> >
> > Has any kind sole got any info on this or a pointer to the location of any info.
>
> I am not sure what exactly you were trying to do, but this is what I was
> doing, when I got into similar problems.
>
> My application starts with Java (where the main function is), and using
> Java Native Interface, I got into C, and then C++, and eventually called
> Performer functions. And in this case, everytime, it encountered an
> iostream call, it was crashing.
>
> After lot of research, we found that it was a simple C++ issue. Just
> before main() function is called, the global constructors are called,
> thereby initializing the iostream stuff. In my case, there was no main()
> in the C/C++ side (it was in the Java side). So, the initizlizations
> were never done.
>
> So, this is going to happen, whenever you don't have a C/C++ main() in
> your application. This has nothing to do with Performer (as far as I
> know).
>
> There is a workaround (assuming that this is what your problem is). From
> tha documentation for CC/ld you can see that you can do the
> initializations yourself as below:
>
> #include <iostream.h>
>
> extern Iostream_init *io;
>
> io = Iostream_init();
>
> The first two lines comes all the way in the beginning of your first C++
> file, and the third line (please check the exact syntax) probably before
> any cerr/cout/cin.
>
> Hope this helps.
>
> --
> Prakash Mahesh
> prakash++at++drawcomp.com
> --or--
> prakash++at++openworlds.com
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:19 PDT