豬頭 (beezari) wrote,
豬頭
beezari

Porting ruby bindings to windows. tweak #1

Проковырялся весь вечер выясняя как же епрст собрать ДЛЛ на винде так чтобы ее так же круто как на унихе можно было через dlopen/dlsym chitat'.. Kluch problemi: (dllexport) [tip] _cdecl function() {... }

Spent whole freaking evening trying to port ruby's spread library C binding to windows. Ruby just wouldn't see the Init_spread() symbol inside the DLL. The key point was - the init function in ruby's binding C file should be declared as (dllexport) void _cdecl Init_spread() {... } to make sure that the function name won't be changed and it still would be visible within DLL export table.


The other interesting observation: compilers on windows platform are mad hell. Each of them has his own convention to name functions. For some obscure reason when i was trying to build stuff with watcom compiler, I'd get heaps of 'unresolved refernces' to [functionname]_is functions. Didn't figure out how to solve this bit, so I simply rebuilt the whole thing with VC7.

VC7 command line is also ffreaky, apparently you need to tell alot of stuff (including location of windows.h) through command line switches otherwise the thing just wouldn't build......
Subscribe

  • OpenVAS 4.x/5.x from SVN source

    Didn't see any around. so here are my notes. Build instructions for Debian and ubuntu. Assuming pcap, libc, gcc are already installed. build…

  • Ubuntu Custom CD: a quick and dirty way

    A few notes on my practical experience of building custom ubuntu disks. I work here with Ubuntu Precise (12.04). But any other Ubuntu distro should…

  • socket proxy in erlang

    Since I started spitting out some code here, here's another thing I've been playing recently. Erlang. For kicks, I decided to implement a socket…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 11 comments

  • OpenVAS 4.x/5.x from SVN source

    Didn't see any around. so here are my notes. Build instructions for Debian and ubuntu. Assuming pcap, libc, gcc are already installed. build…

  • Ubuntu Custom CD: a quick and dirty way

    A few notes on my practical experience of building custom ubuntu disks. I work here with Ubuntu Precise (12.04). But any other Ubuntu distro should…

  • socket proxy in erlang

    Since I started spitting out some code here, here's another thing I've been playing recently. Erlang. For kicks, I decided to implement a socket…