【问题标题】:Functionality of c static library in cpp dllcpp dll中c静态库的功能
【发布时间】:2015-08-18 14:16:41
【问题描述】:

我有一些功能,例如:

header.h

void printFunc();

静态库.c

#include <stdio.h>
#include "header.h"

void printFunc()
{
    printf("Hello from C static lib");
}

我需要在 cpp dll 中使用这个功能。我创建win32项目文件,选择dll。在创建的项目中:

-在Configuration properties->C/C++->General->Additional Include Directory中添加dll路径

-将dll名称添加到配置属性->链接器->输入->附加依赖项。

我的解决方案仍然无法正常工作。我收到错误,无法打开 .lib 文件。

我该如何解决?

【问题讨论】:

  • 盲猜:权限?
  • CPP 是 C 预处理器。如果你说的是 C++,请写出来!

标签: c++ c dll


【解决方案1】:

也许你还没有将 lib 路径添加到库目录。

【讨论】:

  • 不是配置属性-> C/C++ -> 通用-> 附加包含目录吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多