Skip to content

Instantly share code, notes, and snippets.

@lotherk
Created March 23, 2016 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lotherk/ffda5a5eac27e4df0733 to your computer and use it in GitHub Desktop.
Save lotherk/ffda5a5eac27e4df0733 to your computer and use it in GitHub Desktop.
#include <ruby.h>
int main() {
ruby_init();
return 0;
}
cygwins gcc:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/5.3.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-5.3.0-3.i686/src/gcc-5.3.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.3.0-3.i686/src/gcc-5.3.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.3.0 (GCC)
--- output using cygwins ruby (pkg-config --cflags --libs ruby used)
$ gcc -I/usr/include/ruby-2.2.0 -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import -lruby220 -ldl test.c
/tmp/ccAmQNp9.o:test.c:(.text+0xc): undefined reference to `ruby_init'
collect2: error: ld returned 1 exit status
--- output using cygwins gcc and rubyinstaller (with devkit) (no pkg-config used)
$ gcc -I/cygdrive/d/Ruby22/include/ruby-2.2.0/i386-mingw32/ -I/cygdrive/d/Ruby22/include/ruby-2.2.0/ test.c
In file included from /cygdrive/d/Ruby22/include/ruby-2.2.0/ruby/ruby.h:24:0,
from /cygdrive/d/Ruby22/include/ruby-2.2.0/ruby.h:33,
from test.c:1:
/cygdrive/d/Ruby22/include/ruby-2.2.0/i386-mingw32/ruby/config.h:160:15: error: two or more data types in declaration specifiers
#define uid_t int
^
/cygdrive/d/Ruby22/include/ruby-2.2.0/i386-mingw32/ruby/config.h:161:15: error: two or more data types in declaration specifiers
#define gid_t int
^
In file included from /cygdrive/d/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1710:0,
from /cygdrive/d/Ruby22/include/ruby-2.2.0/ruby.h:33,
from test.c:1:
/cygdrive/d/Ruby22/include/ruby-2.2.0/ruby/intern.h:353:9: error: unknown type name 'fd_set'
typedef fd_set rb_fdset_t;
^
/cygdrive/d/Ruby22/include/ruby-2.2.0/ruby/intern.h:454:79: warning: 'struct timeval' declared inside parameter list
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
/cygdrive/d/Ruby22/include/ruby-2.2.0/ruby/intern.h:454:79: warning: its scope is only this definition or declaration, which is probably not what you want
/cygdrive/d/Ruby22/include/ruby-2.2.0/ruby/intern.h:455:32: warning: 'struct timeval' declared inside parameter list
void rb_thread_wait_for(struct timeval);
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment