F
flyaflya
I want use a c lib in vc6. so I use extern "C" to c function, include
three files "test.cpp", "b.h" and "b.c":
//************************************************
// test.cpp
#include "stdafx.h"
#include "b.h"
int main(int argc, char* argv[])
{
return b();
}
//************************************************
//b.h
#if !defined __B_HHHHHH
#define __B_HHHHHH
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
extern "C" int b(); //error occur
#endif
//************************************************
//b.c
#include "b.h"
int b()
{
return 111;
}
error:
d:\test\testco\b.h(10) : error C2059: syntax error : 'string'
I think it's simple, but what wrong? owing to my ide?
three files "test.cpp", "b.h" and "b.c":
//************************************************
// test.cpp
#include "stdafx.h"
#include "b.h"
int main(int argc, char* argv[])
{
return b();
}
//************************************************
//b.h
#if !defined __B_HHHHHH
#define __B_HHHHHH
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
extern "C" int b(); //error occur
#endif
//************************************************
//b.c
#include "b.h"
int b()
{
return 111;
}
error:
d:\test\testco\b.h(10) : error C2059: syntax error : 'string'
I think it's simple, but what wrong? owing to my ide?