在哪里可以找到unix的函数库
如Dlopen这样的函数,在msdn上无该函数内容,想问下是否是操作系统的系统函数库。
请dx指导
问题点数:20、回复次数:5Top
1 楼bhj5787(bihj)回复于 2007-03-20 09:06:47 得分 0
upTop
2 楼iu_81(黄云万里动风色,白波九道流雪山。)回复于 2007-03-20 09:44:13 得分 0
http://man.he.net/Top
3 楼jixingzhong(瞌睡虫·星辰)回复于 2007-03-20 09:44:41 得分 0
main.cpp:
#include <iostream>
#include <dlfcn.h>
int main() {
using std::cout;
using std::cerr;
cout << "C++ dlopen demo\n\n";
// open the library
cout << "Opening hello.so...\n";
void* handle = dlopen("./hello.so", RTLD_LAZY);
if (!handle) {
cerr << "Cannot open library: " << dlerror() << '\n';
return 1;
}
// load the symbol
cout << "Loading symbol hello...\n";
typedef void (*hello_t)();
// reset errors
dlerror();
hello_t hello = (hello_t) dlsym(handle, "hello");
const char *dlsym_error = dlerror();
if (dlsym_error) {
cerr << "Cannot load symbol 'hello': " << dlsym_error <<
'\n';
dlclose(handle);
return 1;
}
// use it to do the calculation
cout << "Calling hello...\n";
hello();
// close the library
cout << "Closing library...\n";
dlclose(handle);
}
hello.cpp:
#include <iostream>
extern "C" void hello() {
std::cout << "hello" << '\n';
}
http://www.isotton.com/howtos/C++-dlopen-mini-HOWTO/C++-dlopen-mini-HOWTO.htmlTop
4 楼jixingzhong(瞌睡虫·星辰)回复于 2007-03-20 09:45:15 得分 0
可以查看这里:
http://www.opengroup.org/onlinepubs/009695399/functions/dlopen.htmlTop
5 楼yingle2000(音乐天堂)回复于 2007-03-31 19:13:18 得分 0
windows不提供dlopen这个api,这个是xUIX的POSIX函数。Top





