1 /* $Id: tstdl.cpp,v 1.2 2006-01-11 17:57:38 mike Exp $
2 Copyright (c) 2005, Index Data.
17 int main(int argc, char **argv)
22 cerr << "bad args" << endl << "Usage: tstdl filename symbol" << endl;
25 void *mod = dlopen(argv[1][0] ? argv[1] : 0, RTLD_NOW|RTLD_LOCAL);
28 cerr << "dlopen failed for file '" << argv[1] << "'\n" <<
29 "dlerror=" << dlerror() << endl;
32 void *sym = dlsym(mod, argv[2]);
33 printf("sym=%p\n", sym);
37 cerr << "dl lib not enabled or not supported" << endl;
45 * indent-tabs-mode: nil
46 * c-file-style: "stroustrup"
48 * vim: shiftwidth=4 tabstop=8 expandtab