原帖由 sunlan 于 2006-9-11 14:59 发表
dlsym返回的是NULL,表示调用不成功。
原帖由 JohnBull 于 2006-9-11 23:14 发表
非也非也
man dlsym
Since the value of the symbol
could actually be NULL (so that a NULL return from dlsym() need not
indicate an error), the correct way to test for an error is to call
dlerror() to clear any old error conditions, then call dlsym(), and
then call dlerror() again, saving its return value into a variable, and
check whether this saved value is not NULL.
dlsym() looks for a definition of symbol in the shared object designated
by handle. The symbols address is returned. If the symbol cannot be re-
solved, NULL is returned.
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |