【发布时间】:2017-03-18 10:38:50
【问题描述】:
所以我有一个问题。 我读过很多东西,但似乎没有什么对我有用。
我有这个 C 库,我用文件制作了项目:
//send.h
#ifndef SEND_H
#define SEND_H
#ifdef __cplusplus
extern "C" {
#endif
static int Send_Sample(void);
#ifdef __cplusplus
}
#endif
#endif /* SEND_H */
我有
//send.c
#include "thatLibrary.h"
static int Send_Sample(void)
{ return 0; }
所以我将项目创建为 Empty DLL,然后我构建了它,一切正常。 但是当我制作另一个项目并在其中引用这个项目时,我会这样做
#include "send.h"
这个包含正在工作,他看到了那个 .h 文件,但是当我构建另一个项目时,它说:
Error C2129 static function 'int Send_Sample(void)' declared but not defined AzureEventHubClient c:\users\v-vlvesi\documents\github\azureeventhubclibrary\azureeventhubclient\source.cpp 9
有谁知道如何解决这个问题?
谢谢!
【问题讨论】:
-
尝试从您的函数中删除
static修饰符。
标签: c++ c visual-studio dll static-libraries