Hello.

Here is the error:
AvatarHeli.cc: In member function 'virtual int AvatarHeli::Init(WorldFile*, WorldFileNode*)':
AvatarHeli.cc:309: error: cast from 'AvatarHeli*' to 'int' loses precision
AvatarHeli.cc:309: error: cast from 'Model*' to 'int' loses precision
make[5]: *** [AvatarHeli.o] Error 1

The line:
if (gz_position_create(this->position, this->world->gz_server, this->GetId(), "AvatarHeli", (int) this, (int) this->parent) != 0)
Pointers on amd64 are 8byte sized while integers are 4byte sized. Gazebo casts a pointer to a integer wich is correct only on-32bit computers. I fixed this bug by changing (int) to (long int), what is correct only on 64bits computers (gazebo works ok). I think the pointer should be casted to a (void *) as it will be a pointer and there will be no conflicts since (void *) and (AvatarHeli *) are allways the same size.
It should be changed to:
if (gz_position_create(this->position, this->world->gz_server, this->GetId(), "AvatarHeli", (void *) this, (void *) this->parent) != 0)



In addition, the vsnprintf bug at gz_error_print() (segfault) was not fixed, it crashes on amd64. This is from the manpage of vsnprintf:

The functions vprintf(), vfprintf(), vsprintf(),  vsnprintf()  are  equivalent  to  the  functions  printf(),
fprintf(), sprintf(), snprintf(), respectively, except that they are called with a va_list instead of a vari-
able number of arguments. These functions do not call the va_end macro. Consequently,  the  value  of  ap  is
undefined after the call. The application should call va_end(ap) itself afterwards.

This undefined value causes the segmentation fault.