C++调用C文件

     方法:

               步骤:    把c文件添加到项目中,点击右键属性->预编译头->不使用预编译头。

                            假如C文件声明在某个.h文件中,则需要把头文件添加到extern "C"中,如下:

                

                        

extern "C"
{
#include "sift.h"
#include "imgfeatures.h"
#include "kdtree.h"
#include "utils.h"
#include "xform.h"
//...C语言函数声明或者头文件,标识用C来编译
};

 

  提示:想知道其中原理:http://www.cnblogs.com/skynet/archive/2010/07/10/1774964.html

posted on 2011-09-27 17:40  DoubleSnake  阅读(2396)  评论(0编辑  收藏  举报