c++链接错误,高手请帮忙
如下3个文件:
//h1.h
#ifndef H1_H
#define H1_H
extern int aa(int x, int y);
#endif
//h1.c
#include "h1.h"
int aa(int x , int y)
{
return x+y;
}
//cpp1.cpp
#include <iostream>
extern "C"
{
#include "h1.h"
}
using namespace std;
int main()
{
cout << aa(1,2);
}
为什么链接的时候报错呢?
g:\program files\microsoft visual studio\myprojects\projecttest\cpp1.cpp(55) : error C2064: term does not evaluate to a function