Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¼òµ¥µÄlinux¶¯Ì¬¼ÓÔØ

==================ÕâÊǶ¯Ì¬¿âte.cppÎļþ
#include <stdio.h>
#include <string.h>
//ÕâÒ»¾äÒ»¶¨ÒªÓÐ,ÕâÊǵ¼³ö¸Ãº¯Êý
extern "C" void add(); 
void add()
{
printf("@hk.%s(%d): This is add function! \n", __FILE__, __LINE__);
}
g++ -fPIC -shared -o ./libte.so ./te.cpp
==================ÕâÊǵ÷Óö¯Ì¬¿âµÄmain.cppÎļþ
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dlfcn.h> /* ±ØÐë¼ÓÕâ¸öÍ·Îļþ */
#include <assert.h>
typedef void (*add_t)();
int main(int argc, char *argv[])
{
  void *handle = NULL;
add_t add;
handle = dlopen("./libte.so", RTLD_LAZY);
if (handle == NULL)
{
printf("@hk.%s(%d): The share library load fail!\n", __FILE__, __LINE__);
return -1;
}
add = (add_t)dlsym(handle, "add");
if (add == NULL)
{
printf("@hk.%s(%d): Load function symbol fail!\n", __FILE__, __LINE__);
}
add();
dlclose(handle);
return 0;
}
g++ -o main main.cpp -ldl


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

[ת]Linux½¨Á¢Á´½Ó½â¾ö¿Õ¼ä²»¹»µÄÎÊÌâ


×÷Õß: ÈýÊ®¶øÁ¢
ʱ¼ä£º2009Äê11ÔÂ03ÈÕ 9:52:27
Çë×ðÖØÔ­´´×÷Æ·¡£×ªÔØÇë±£³ÖÎÄÕÂÍêÕûÐÔ,²¢ÒÔ³¬Á´½ÓÐÎʽעÃ÷ԭʼ×÷Õß“inthirties£¨ÈýÊ®¶øÁ¢£©”ºÍ³ö´¦”http://blog.csdn.net/inthirties/archive/2009/11/03/4761783.aspx”,ÉîÈëÌÖÂÛ¿ÉÒÔÁªÏµinthirties@gmail.com¡£
 ½ñÌìÀ´µ½¹«Ë¾£¬ÓÐС»ï× ......

linux¾­µäÊé

ת×Ôhttp://www.diybl.com/course/6_system/linux/Linuxjs/200876/130723.html
 Linux»ù´¡
1¡¢¡¶LinuxÓëUnix Shell ±à³ÌÖ¸ÄÏ¡·
CÓïÑÔ»ù´¡
1¡¢¡¶C Primer Plus£¬5th Edition¡·¡¾ÃÀ¡¿Stephen PrataÖø
2¡¢¡¶The C Programming Language, 2nd Edition¡·¡¾ÃÀ¡¿Brian W. Kernighan David M. Rithie£¨K & R£©Öø
3¡¢ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ