mrfangzheng

Hope and fear are useless. Be confident, and always be prepared for the worst.
  首页  :: 新随笔  :: 联系 :: 管理

VS2008创建C++DLL, 该DLL中的Class并被C++App调用

Posted on 2010-02-04 17:50  mrfangzheng  阅读(1008)  评论(0编辑  收藏  举报
  1. 创建DLL
    1. 创建Win32 Console Application工程TheClasses 
    2. 创建选项中选中 DLL, Export Symbols
    3. 所有要导出的类都必须 class __declspec(dllexport) YourClassName {};
  2. 创建App
    1. 创建Win32 Console Application工程App
    2. 创建完毕后在工程属性页, Configuration=Active(Debug)
      1. 设置Linker->General->Additional Library Directories, 添加目录 Solution目录\Debug
      2. 设置Linker->Input->Additional Dependencies, 添加TheClasses.lib(扩展名是lib)