C++ compiling Error fatal error LNK1169: one or more multiply defined

fatal error LNK1169: one or more multiply defined symbols found

Page 1 of 1

3 Replies - 9523 Views - Last Post: 20 April 2009 - 03:47 AM Rate Topic: -----

#1 justntyme  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 19-April 09

C++ compiling Error fatal error LNK1169: one or more multiply defined

Posted 19 April 2009 - 06:35 PM

/******************************************************/
/* File: name of your file with the source code */
/* */
/* Created by: give your name */
/* Date: give the date */
/* */
/* Program to compute the x ^ y */
/* */
/* Inputs: (keyboard) */
/* 1. One integer exponent (y), y >= 0 */
/* 2. One float number (x) */
/* */
/* Output: */
/* Print x^y as a float, on the screen */
/* */
/* Algorithm: set a variable equal to 1, then multiply*/
/* that variable by x, y times */
/* */
/******************************************************/
#include <iostream>

using namespace std ;

int main()
{
// declaring variables:

float x ;
int y, i ;
float result = 1 ;

// read in the two numbers

cout << endl ;

cout << "Enter number to be raised to power(float) : ";
cin >> x ;

cout << "Enter the exponent (non-negative integer) : " ;
cin >> y ;

for (i = 1; i <= y; i++)
{
result = result * x;
}

// display the result

cout << endl ;
cout << "The value of" << x << " to power " << y
<< " is : " << result << endl ;

return (0); // terminate with success
}

Is This A Good Question/Topic? 0
  • +

Replies To: C++ compiling Error fatal error LNK1169: one or more multiply defined

#2 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2009
  • View blog
  • Posts: 5,387
  • Joined: 27-December 05

Re: C++ compiling Error fatal error LNK1169: one or more multiply defined

Posted 19 April 2009 - 09:13 PM

Check again. There's nothing in this code that should give you a compilation error.
Was This Post Helpful? 0
  • +
  • -

#3 leokrish  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 30
  • Joined: 15-April 09

Re: C++ compiling Error fatal error LNK1169: one or more multiply defined

Posted 19 April 2009 - 11:50 PM

i have check your code and run it and it si perfectly running....
so there is no mistake in the code...

there is some other reason for the compilation error....
check that
Was This Post Helpful? 0
  • +
  • -

#4 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: C++ compiling Error fatal error LNK1169: one or more multiply defined

Posted 20 April 2009 - 03:47 AM

What compiler / IDE are you using?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1