Member access into incomplete type ‘struct REALstringStruct'

  1. 2 years ago

    James S

    20 Jul 2017 Pre-Release Testers, Xojo Pro

    Lots of setbacks the last couple of days trying to learn some new things ;) I am now looking to wrap a C++ library into a plugin. I tried to load up some of the examples but I can’t get either the completeModule or the completeClass example to compile. This is on OSX with XCode 7.3. I’ve followed Normans instructions at this link: http://great-white-software.com/miscellaneous/Plugins%20Getting%20started.pdf and updated the search paths and other XCode settings and that seems all OK. But I still cannot generate even the example plugins. I get the error in the title of this when compiling the completeClass example.

    Member access into incomplete type ‘struct REALstringStruct’

    The error is thrown three times during the build process, here’s the first example:

    static REALstring HumanNameGetter( REALobject instance )
    {
    	// We need to get our class instance data from the object
    	// we've been passed.
    	ClassData( TestClassDefinition, instance, TestClassData, me );
    
    	// We will always append this to the end of the
    	// cat name
    	const char *kOwner = "'s Owner";
    
    	// Construct a string to return based on the CatName property
    	long bufferSize = me->mCatName->Length() + ::strlen( kOwner ) + 1; //<<<< error is here
    	char *name = new char[ bufferSize ];
    	
    	// Clear the buffer out
    	::memset( name, 0, bufferSize );
    ...

    My incomplete understanding of this error suggests that there is no prototype for the class data before it tries to access it? I can plainly see the declaration of the struct TestClassData above in the CompleteClass.cpp file, but I haven’t studied it long enough to figure out if the idea of adding a prototype somewhere is valid. There is no CompleteClass.hh file or any headers that might include the prototypes.

    I can’t really make any progress till I can at least compile an example plugin and learn from there. Any help or pointers to other documents I should read about making Xojo plugins greatly appreciated. Thank you!

  2. Christian S

    20 Jul 2017 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    We were asked to not use those direct accessors and better go through functions like REALGetStringData.

  3. James S

    20 Jul 2017 Pre-Release Testers, Xojo Pro

    but this is the EXAMPLE CODE! How am I supposed to know that I have to rewrite the examples? This is the code from the most recent release and it’s wrong?

  4. Christian S

    20 Jul 2017 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    This is old example code using deprecated functions and if you still have a .h file with those C++ accessors, you can compile it.

  5. James S

    22 Jul 2017 Pre-Release Testers, Xojo Pro

    sorry, I’ve been fighting with this unable to make even the most basic progress for several days and I might have over reacted ;)

    Are there any plugin examples that actually compile after you fix the paths in XCode? Where should I start in order to learn how to do this sort of thing?

or Sign Up to reply!