这是一个程序:
#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";
}
}
在编译(Windows 7 上的 Microsoft Visual C++ 2010 Express)时,我收到错误消息:
致命错误 LNK1169:找到一个或多个多重定义的符号