1 /* $Id: tstdl.cpp,v 1.6 2007-05-09 21:23:09 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 This file is part of Metaproxy.
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
32 int main(int argc, char **argv)
37 cerr << "bad args" << endl << "Usage: tstdl filename symbol" << endl;
40 void *mod = dlopen(argv[1][0] ? argv[1] : 0, RTLD_NOW|RTLD_LOCAL);
43 cerr << "dlopen failed for file '" << argv[1] << "'\n" <<
44 "dlerror=" << dlerror() << endl;
47 void *sym = dlsym(mod, argv[2]);
48 printf("sym=%p\n", sym);
52 cerr << "dl lib not enabled or not supported" << endl;
60 * indent-tabs-mode: nil
61 * c-file-style: "stroustrup"
63 * vim: shiftwidth=4 tabstop=8 expandtab