在VS2013下写了个简单的程序,包括一个function.h,function.cpp,main.cpp,调试的时候出现以下问题,不知道哪里不对,求大虾帮忙
蜂芒 2016-03-02 05:28:35 /* function.h */
#pragma once
#ifndef _INC_OFFICEFUNCTION
#define _INC_OFFICEFUNCTION
#include <crtdefs.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define Pi 3.141592654 /* define Pi */
typedef struct PlaneCoordinate /* define struct for descrbing Plane Coordinate */
{
double x, y;
}PlaCoo;
extern PlaCoo GetPoint(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#pragma pack(pop)
#endif /* _INC_OFFICEFUNCTION */
/* function.cpp */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct PlaneCoordinate /* define struct for descrbing Plane Coordinate */
{
double x, y;
}PlaCoo;
PlaCoo GetPoint(void) //声明一个结构体PlaneCoordinate类型的变量,并输入赋值
{
PlaCoo point;
scanf_s("%lf,%lf", &point.x, &point.y);
return point;
}
/* main.h */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "officefunction.h"
using namespace std;
int main(void)
{
PlaCoo point = GetPoint();
printf_s("%lf,%lf\n", point.x, point.y);
system("pause");
return 0;
}
/* 出现问题 */
警告 1 warning C4161: #pragma pack(pop...) : 出栈的比入栈的多 c:\users\xujinhao\documents\visual studio 2013\projects\office calculation of conneting traverse\office calculation of conneting traverse\officefunction.h 26 1 Office Calculation of Conneting Traverse
错误 2 error LNK2019: 无法解析的外部符号 _GetPoint,该符号在函数 _main 中被引用 C:\Users\xujinhao\documents\visual studio 2013\Projects\Office Calculation of Conneting Traverse\Office Calculation of Conneting Traverse\Main.obj Office Calculation of Conneting Traverse
错误 3 error LNK1120: 1 个无法解析的外部命令 C:\Users\xujinhao\documents\visual studio 2013\Projects\Office Calculation of Conneting Traverse\Debug\Office Calculation of Conneting Traverse.exe 1 1 Office Calculation of Conneting Traverse