Originally posted by: Broncho
Hi All,
I write the codes like that:
try {.......}
catch (IloException& ex) {
//cerr << "Error: " << ex << endl;
cerr<<ex.getMessage()<<endl;
}
catch (...) {
cerr << "Error" << endl;
}
But when I build solution, two errors come up. They are:
error LNK1120: 1 unresolved externals
error LNK2001: unresolved external symbol "public: virtual void __thiscall IloException::print(class std::basic_ofstream<char,struct std::char_traits<char> > &)const " (?print@IloException@@UBEXAAV?$basic_ofstream@DU?$char_traits@D@std@@@std@@@Z)
The relevant class can be found in ilosys.h. It says:
class ILO_EXPORTED IloException : public IloQuietException { // here because needed by threads
public:
IloException(const IloException&);
~IloException();
IloException& operator=(const IloException&);
virtual const char* getMessage() const;
virtual void print(ILOSTD(ofstream)& out) const;
virtual void end();
protected:
IloException(const char* message = 0, IloBool deleteMessage=IloFalse);
};
But I don't know whether it has problem.
I used VS2010 to program. When I follow the settings of C++ project, I did exactly the same as the steps on...\ILOG\CPLEX_Studio1251\cplex\c_cpp.html. Thus, I don't know how these two errors come.
Does anyone know the reason? Thank you very much!
#CPLEXOptimizers#DecisionOptimization