急阿~~~~C函数库连接到C++程序后无法正常编译、使用
我在linux下写了一个C的api函数库,和其他的一些C函数库一起编译成了静态库, 别人的程序是用C++写的程序, 要用到我的C函数库, 请问在C函数库改动量不大的情况下如何让C++程序正常使用C的API,
代码如下,恳请高手指点,请仔细说明下,急用,谢谢了
[size=7]api.h:[/size]
[size=6]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <pthread.h>
#include <malloc.h>
#include <signal.h>
#include "RegisterDevice.h"
#include "Api.h"
#ifndef SUCCESS
#define SUCCESS 0
#endif
#ifndef FAILED
#define FAILED -1
#endif
#ifndef MAX_CMD_LEN
#define MAX_CMD_LEN 60
#endif
#ifndef MAX_BUF_LEN
#define MAX_BUF_LEN 60
#endif
#ifndef DEFAULT_ARGS
#define DEFAULT_ARGS 5
#endif
extern int set_devname(const char *devname);
extern int ushare(const char *sharename);
extern int share(const char *sharename, c
相关问答:
C\C++如何计算函数的导数,本人新手,想写个程序,但是不知道如何下手,还望高手指点一二,谢过。
这个……
跟函数的具体形式有关吧,难道你想编出个“万能”的求导函数?
俺上学时想过自动推导公式,后来 ......
问一下:
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
'\108'作为字符常量对不对?
转义字符'\ddd'表示3位8进制所代表的字符。 但是108不是正确的8进制表示方法,因此应该是错误的。
但是char a='\108'; 为什么编译不出错呢?
\108 没超过 ......
//C 接口
extern "C"
{
TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);
}
//我在C#中声明
//调用C DLL 中的函数
[DllImport("OCRapi.dll&quo ......
/* Note:Your choice is C IDE
作用: 随机数加密法,,,,
以下有许多不懂,请教一下,请主意代码;
*/
#include <stdio.h>
#include <stdlib.h>
union
{
int value;
struct
{
c ......