2016-11-04 123 views
0

所以我有一个问题。 我已经读了很多东西,但似乎没有任何工作适合我。在C++项目中使用c DLL

我有这样的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; } 

所以我创建的项目为空的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 

有谁知道如何解决这个问题?

谢谢!

+0

尝试从功能删除了'static'修改。 – StaticBeagle

回答