# Problems when building C extensions with ruby 1.8.7

**URL:** <https://www.ruby-forum.com/t/problems-when-building-c-extensions-with-ruby-1-8-7/139933>\
**Category:** Ruby\
**Created:** [June 9, 2008, 10:13am UTC](https://www.ruby-forum.com/t/problems-when-building-c-extensions-with-ruby-1-8-7/139933 "2008-06-09T10:13:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crocco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crocco](https://www.ruby-forum.com/u/crocco)\
**Post date:** [June 9, 2008, 10:13am UTC](https://www.ruby-forum.com/t/problems-when-building-c-extensions-with-ruby-1-8-7/139933/1 "2008-06-09T10:13:20Z")

</div>

Hello to everyone. Today, I just tried installing ruby 1.8.7, and now  
I’m  
having problems compiling a C extension for it. In particular, the  
extension  
was svn version of korundum/qt-ruby, which compiled correctly with ruby  
1.8.6.  
Now, I’m getting this message:

/home/stefano/Desktop/kdebindings/ruby/qtruby/src/Qt.cpp: In function  
‘VALUE  
method\_missing(int, VALUE\*, VALUE)’:  
/home/stefano/Desktop/kdebindings/ruby/qtruby/src/Qt.cpp:715: error:  
invalid  
conversion from ‘const char\*’ to ‘char\*’

The line in question reads:

char \* methodName = rb\_id2name(SYM2ID(argv[0]));

I thought that ruby-1.8.7 and ruby 1.8.6 had the same C API, but  
apparently  
it’s not so. Does anyone know more about similar issue? Should I report  
it to  
the qtruby developers or is it a bug in ruby itself?

Stefano

---

<div class="post-metadata">

**Author:** ![crocco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crocco](https://www.ruby-forum.com/u/crocco)\
**Post date:** [June 9, 2008, 12:51pm UTC](https://www.ruby-forum.com/t/problems-when-building-c-extensions-with-ruby-1-8-7/139933/2 "2008-06-09T12:51:17Z")

</div>

On Jun 9, 9:11 am, Stefano C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The line in question reads:
> 
> char \* methodName = rb\_id2name(SYM2ID(argv[0]));
> 
> I thought that ruby-1.8.7 and ruby 1.8.6 had the same C API, but apparently  
> it’s not so. Does anyone know more about similar issue? Should I report it to  
> the qtruby developers or is it a bug in ruby itself?  
> Thanks for the bug report, it looks like that function changed from  
> being a ‘char \*’ to a ‘const char \*’ in Ruby 1.8.7. I’ve fixed it in  
> the QtRuby svn now, but haven’t had time to actually try building and  
> testing against 1.8.7 yet.

– Richard
