dynamic libraries example

dynamic libraries example

Postby Antonio Linares » Mon Apr 25, 2011 1:11 am

gcc test.c -o test
./test

test.c
Code: Select all  Expand view
#include <stdio.h>
#include <dlfcn.h>

void hb_vmInit( int );

int main( char * arg, int args )
{
    void * handle = dlopen ( "libharbour.2.1.0.dylib", RTLD_LAZY );
    void ( * hb_vmInit ) ( int );

    hb_vmInit = dlsym( handle, "hb_vmInit" );
    ( * hb_vmInit )( 1 );

    dlclose( handle );

    return 0;
}
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Return to FiveLinux / FiveDroid (Android)

Who is online

Users browsing this forum: No registered users and 8 guests