在路上...

The development of life
我们一直都在努力,有您的支持,将走得更远...

站内搜索: Google

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
过程如下所示:

/* shrobj.c 文件 */
const char *myfunc()
{
    return "Hello World";
}


/* hello.c 文件 */
#include <stdio.h>

extern const char *myfunc();

main()
{
    printf("%s\n", myfunc());
    return 0;
}


编译:
  gcc -fpic -c shrobj.c
  gcc -shared -o -fpic shared.dll shrobj.o
  gcc -o hello.exe hello.c shared.dll

运行:
  hello.exe
  Hello World

posted on 2009-08-26 21:21  palam  阅读(200)  评论(0编辑  收藏  举报