Ruby Embedding and Compilation

How do you compile a C application with embedded Ruby?

What does the -l flag mean? Is there anything else that I am missing (link to the exact ruby โ€‹โ€‹version)

+4
source share
1 answer

Embedding a language usually associates an interpreter with a binary that implements it, -l associates a library with a program, you can try:

 gcc -Wall -I/usr/include/ruby-1.9.1/ myprog.c -o myprog -lruby 

Please note that you may need to enable this too or similar on your platform:

 -I/usr/include/ruby-1.9.1/x86_64-linux/ 
+2
source

Source: https://habr.com/ru/post/1445987/


All Articles