Visual C ++ 2010 - fatal error LNK1169: one or more characters with multiple values ​​were found

This program:

#include <iostream>
using namespace std;

int main() {
cout << "Enter a number";
int i;
cin >> i;
try {
    if( i == 0 ) throw 0;
    if( i == 2 ) throw "error";
} catch( int i ) {
    cout << "can't divide by 0";
 }
   catch( ... ) {
       cout << "catching other exceptions";
   }
}

When compiling (Microsoft Visual C ++ 2010 Express on Windows 7) I get an error message:

fatal error LNK1169: one or more multiple-found characters found

+5
source share
4 answers

There is actually no error in this code .

There may be a problem with the number of source files. Try this code as a new project in the same compiler or try deleting files from the option source fileson the left side of the text area (where you write your code)

.

+16

, , , , , main (int main) .cpp , .cpp (int main()).so , . , .cpp (int main), .cpp (int submain) , .

+4

int main() int submain().

+2
source

I suspect your error comes from this line:

catch(int i)

You already have a variable named so in this range. In addition, you should catch exceptions, not an integer.

-3
source

All Articles