Linking with inline methods
-
Hello, I was wondering if any of you CPers know how to solve this problem i've come across with. I've defined about four or so methods in this class of mine as
inline
and, it appears, the linker cannot find the method's definitions in the.OBJ
. The only way of solving this issue is by NOT defining the method(s) asinline
. How do I do about solving this, while at the same time keepinginline
declaration? Thanks a lot David Linker Error:Linking...
LINK : LNK6004: Debug/xtest.exe not found or not built by the last incremental link; performing full link
xtestDlg.obj : error LNK2001: unresolved external symbol "public: char const & __thiscall XField::GetText(void)" (?GetText@XField@@QAEABDXZ)
Debug/xtest.exe : fatal error LNK1120: 1 unresolved externals -
Hello, I was wondering if any of you CPers know how to solve this problem i've come across with. I've defined about four or so methods in this class of mine as
inline
and, it appears, the linker cannot find the method's definitions in the.OBJ
. The only way of solving this issue is by NOT defining the method(s) asinline
. How do I do about solving this, while at the same time keepinginline
declaration? Thanks a lot David Linker Error:Linking...
LINK : LNK6004: Debug/xtest.exe not found or not built by the last incremental link; performing full link
xtestDlg.obj : error LNK2001: unresolved external symbol "public: char const & __thiscall XField::GetText(void)" (?GetText@XField@@QAEABDXZ)
Debug/xtest.exe : fatal error LNK1120: 1 unresolved externals -
Yes, that is true. I have defined it in the class declaration - in the header file - and I've coded the method(s) in the actual source file (
.cpp
) . I take it you mean I can't insert the code in the source file but only in the header? David BTW, thanks for the reply