当前位置: 动力学知识库 > 问答 > 编程问答 >

C++ Compiling fatal error

问题描述:

So I am currently learning how to code using C++. I am trying to get the following code to execute. The purpose of the code is to, when executed, allow the user to enter in the radius of a circle which the application will then automatically output the entered radius attached with the circumference and the area.

Below is the code:

#include<iostream>

#include<cmath>

using namespace std;

int main()

{

float radius;

float circumference;

float area;

cout << "Please enter the radius of the circle: ";

cin >> radius;

cout << endl;

circumference = 2 * 3.1416 * radius;

area = 3.1416 * radius * radius;

cout << "Radius = " << radius << endl;

cout << "Area = " << area << endl;

cout << "circumference = " << circumference << endl;

}

Whenever I executed the the program though, I get one error that reads 'fatal error LNK1169: one or more multiply defined symbols found'

If you think you could help solve this error and teach me how to avoid this error in the future, I'd greatly appreciate your help!

Thanks and have a nice day :)

Jack.

网友答案:

You have not shown us your real code (as shown by the missing semicolon after using namespace std, which would have caused a compilation error), and/or your IDE is misconfigured to link some module in twice or more.

分享给朋友:
您可能感兴趣的文章:
随机阅读: