```ruby
require 'mkmf'
require 'fileutils'

Dir.chdir "../../leveldb"
system "make libleveldb.a" or abort
Dir.chdir "../ext/leveldb"

$CFLAGS << " -I../../leveldb/include"
$LIBS << " -L../../leveldb -lleveldb"
create_makefile "leveldb/leveldb"
```

Fix "undefined symbol: __cxa_pure_virtual" error on load.
user
```ruby
require 'mkmf'
require 'fileutils'

Dir.chdir "../../leveldb"
system "make libleveldb.a" or abort
Dir.chdir "../ext/leveldb"

CONFIG['LDSHARED'] = "$(CXX) -shared"

$CFLAGS << " -I../../leveldb/include"
$LIBS << " -L../../leveldb -lleveldb"
create_makefile "leveldb/leveldb"
```
assistant