I couldn't figure it out why the inline setMessage( ... ) is causing link error ?
Please see the source attached
I couldn't figure it out why the inline setMessage( ... ) is causing link error ?
Please see the source attached
We can't solve problems by using the same kind of thinking we used when we created them
Calls to such functions are replaced* by those functions' code, therefore their definition must be accessible during compilation --- you can't add inline functions in the linking stage.
If you want to use inline methods you must move them to .h files.
* Compilers threat inline keyword as a hint, so they might ignore in some cases.Thread.h:14: warning: inline function `void Thread::setMessage(const QString&)' used but never defined
Do u mean that i shouldn't write inline function in .cpp ?
We can't solve problems by using the same kind of thinking we used when we created them
Yes, unless you plan to use it only within that .cpp file.Originally Posted by sunil.thaha
Thanks A lot
We can't solve problems by using the same kind of thinking we used when we created them
Bookmarks