1 /* $Id: tstdl.cpp,v 1.4 2006-06-10 14:29:13 adam Exp $
2 Copyright (c) 2005-2006, Index Data.
4 See the LICENSE file for details
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