Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Black Wolf on November 27, 2007, 11:38:46 pm

Title: Pure Virtual Function Call?
Post by: Black Wolf on November 27, 2007, 11:38:46 pm
Has anyone else ever gotten this error? It's an unclickable error box (essentially a CTD) that I'm getting with various builds (so I'm fairly sure it's not build related) whenever I click commit from the briefing screen or when I look at certain ships in the techroom (So far a couple of TI ships and the Alastor, though this is still very preliminary - there could be more, or it could be intermittend and unrelated to the specific ships.

Basically just wondering if anyone else has had this, and how/if they fixed it? I'm running XP with a 9500 pro and first encountered the error on 3.6.9. I've tried basics like rebooting, varying the build, a clean data directory etc. but nothing too specific. Any ideas?
Title: Re: Pure Virtual Function Call?
Post by: Kazan on November 29, 2007, 08:46:50 am
a purely virtual function is defined as follows

Code: [Select]
class example
{
         virtual bool doStuff()=0;
}

it's for defining an interface that has be to implemented by children classes as such

Code: [Select]
class example2: public example
{
        virtual bool doStuff() { cout << "I pittah da foo!"; }
}

a "pure virtual function call" runtime error occurs when the instantiated class does not implement it's version of the purely virtual function in the defined interface parent class - so it's vtable contains a null functor which he runtime detects and raises a fatal error (null pointer access)
Title: Re: Pure Virtual Function Call?
Post by: Black Wolf on November 30, 2007, 04:47:49 am
Interesting. I was consistently getting the problem with one fighter until I replaced its pcx maps with tgas. Now, it works, in the tech room at least.
Title: Re: Pure Virtual Function Call?
Post by: Bobboau on December 03, 2007, 04:59:43 pm
the fact that FSO has no virtual functions that I am aware of only makes this more mysterious. though I suppose the error might show up when a null function pointer was called, which FSO DOES use.

and I can't think of a situation were a pure virtual function call could make it to runtime, if you try to instantiate a class with an undefined virtual function it'll give you a syntax error.
Title: Re: Pure Virtual Function Call?
Post by: Black Wolf on December 07, 2007, 05:45:37 am
:(

Bugger. Have been working all week, so no time for FS2 - was hoping someone would have some kind of an idea by now. Oh well - reformat in a week or so, so I suppose that will have to be the next step.