Page 1 of 1

Fixing XCode Errors while building rnaEffect External

Posted: Wed Feb 04, 2009 10:09 pm
by dreamscapesoftware
I've been trying to move over to the Mac side with my externals and I'm starting from the ground up. I began by building the example externals that Mark Waddingham had put together for the tutorials via the newsletter.

The problem is that I am running XCode 3.1.2 on Mac OS X 10.5.6, and I can't seem to get the Universal version of the rnaEffect external to compile.

I keep getting 3 compiler errors originating from the variable.cpp file, and it only happens when I compile in Debug, Release or Release x86-32. The error is the same and affects 3 lines. An example of the error is...

Code: Select all

/rnaeffect/variable.cpp:159: error: invalid conversion from 'const char*' to 'char*'
The code in question is:

Code: Select all

t_ex_string . buffer = p_string . data();
The full set of code that's having problems is...

Code: Select all

void Variable::SetStringElement(const char *p_key, const std::string& p_string)
{
	ExternalString t_ex_string;
	t_ex_string . buffer = p_string . data();          // This produces an Error
	t_ex_string . length = p_string . length();
	SetRawStringElement(p_key, t_ex_string);
}

void Variable::SetCStringElement(const char *p_key, const char *p_cstring)
{
	ExternalString t_ex_string;
	t_ex_string . buffer = p_cstring;          // This produces an Error
	t_ex_string . length = strlen(p_cstring);
	SetRawStringElement(p_key, t_ex_string);
}

void Variable::SetRawBufferElement(const char *p_key, const void *p_buffer, unsigned int p_length)
{
	ExternalString t_raw_string;
	t_raw_string . buffer = (const char *)p_buffer;          // This produces an Error
	t_raw_string . length = p_length;
	SetRawStringElement(p_key, t_raw_string);
}
Does anyone have any idea on how to resolve these errors?

Posted: Sun Feb 15, 2009 3:40 am
by mwieder
Derek-

It's been a while since I compiled the sample externals Mark put together, but I recall having similar problems. If I remember correctly, and that's a long shot, the universal build is looking for the OSX 10.2.8 libraries. You'll need to change the options to build for OSX 10.5 only or 10.5 and 10.4 if the libraries are available to you. It's also (again from memory) set up to use a different version of the compiler when you're building the ppc libraries, and you may need to fiddle with that as well.

I think the short form of the story is that the examples were written against a previous OS build and need to be revisited now.