When trying to inline a function in Visual C++ (2008 express), I got a linking error, after a close inspection of the code, what I discovered is that the function I am trying to inline throws an exception... if I remove the exception throwing, the linking error goes away, can someone explain why it is the case?
int com_ximpleware::FastIntBuffer::intAt(int index){
if (index < 0 || index > size - 1) {
throw InvalidArgumentException("invalid index range in FastIntBuffer's intAt()");
}
return ((int *) al->get(index>>exp))[index & r];
}
The exaxt error is shown below:
intHash.obj : error LNK2019: unresolved external symbol "public: int __thiscall com_ximpleware::FastIntBuffer::intAt(int)" (?intAt@FastIntBuffer@com_ximpleware@@QAEHH@Z) referenced in function __catch$?isUnique@IntHash@com_ximpleware@@QAE_NH@Z$0
1>C:\new_cvs\cpp_test1\Debug\cpp_test1.exe : fatal error LNK1120: 1 unresolved externals
One more thing, this function was invoked else normally, the calling part of the function wasn't included.