mov是什么格式:vc++问题.help!

来源:百度文库 编辑:神马品牌网 时间:2024/04/29 20:55:14
I begin a Blank solution that named AllInOne.ADD a C++ Win32 project named
Math Library and change the Application Settings to a static library.

Next,Select a C++ Win32 Console application and name it Harness.
MathLibrary project in Solution Explorer add a Generic C++ Class that named Arithmetic.

In Solution Explorer, right-click the Harness project and choose Properties.

Under Configuration Properties on the left, expand the C/C++ folder. Click General. Click next to Additional Include Directories on the left and type the relative path to the MathLibrary folder:

../MathLibrary

Solution Explorer, right-click the Harness project and choose Properties.

Under Configuration Properties on the left, expand the Linker folder. Click Input. Click next to Additional Dependencies on the left and type :

../MathLibrary/Debug/MathLibrary.lib

the code in Arithmetic.h:

#pragma once

class Arithmetic
{
public:
Arithmetic(void);
~Arithmetic(void);
double Add(double num1, double num2);
double Subtract(double num1, double num2);
double Multiply(double num1, double num2);
double Divide(double num1, double num2);
};

Arithmetic.cpp code:

#include "StdAfx.h"
#include ".\arithmetic.h"

Arithmetic::Arithmetic(void)
{
}

Arithmetic::~Arithmetic(void)
{
}

double Arithmetic::Add(double num1, double num2)
{
return num1 + num2;
}

double Arithmetic:: Subtract(double num1, double num2)
{
return num1 - num2;
}

double Arithmetic::Multiply(double num1, double num2)
{
return num1 * num2;
}

double Arithmetic::Divide(double num1, double num2)
{
return num1 / num2;
}

// Harness.cpp code:

#include "stdafx.h"
#include "arithmetic.h"
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
Arithmetic a;
cout << "1.2 + 3.2 = " << a.Add(1.2, 3.2) << endl;
cout << "2.1 * 3 = "<< a.Multiply(2.1, 3) << endl;
cin.get();

return 0;
}

finally,i change the Harness project in Solution Explorer As Startup Project.
but can't been compiled.

throw a error:
c:\Documents and Settings\jushu\My Documents\Visual Studio Projects\AllInOne\Harness\Harness.cpp(5) : “arithmetic.h”: No such file or directory

who may help me ! thanks!

什么问题啊.没有看明白啊.